summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
index 277d353d1db1..640be5fe8e8c 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
@@ -1850,13 +1850,12 @@ bool WebAssemblyCFGStackify::fixCallUnwindMismatches(MachineFunction &MF) {
// If the EH pad on the stack top is where this instruction should unwind
// next, we're good.
- MachineBasicBlock *UnwindDest = getFakeCallerBlock(MF);
+ MachineBasicBlock *UnwindDest = nullptr;
for (auto *Succ : MBB.successors()) {
// Even though semantically a BB can have multiple successors in case an
- // exception is not caught by a catchpad, in our backend implementation
- // it is guaranteed that a BB can have at most one EH pad successor. For
- // details, refer to comments in findWasmUnwindDestinations function in
- // SelectionDAGBuilder.cpp.
+ // exception is not caught by a catchpad, the first unwind destination
+ // should appear first in the successor list, based on the calculation
+ // in findUnwindDestinations() in SelectionDAGBuilder.cpp.
if (Succ->isEHPad()) {
UnwindDest = Succ;
break;