mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-18 13:16:24 -04:00
[WebAssembly] Fix a bug when mixing TRY/LOOP markers
Summary: When TRY and LOOP markers are in the same BB and END_TRY and END_LOOP markers are in the same BB, END_TRY should be _before_ END_LOOP, because LOOP is always before TRY if they are in the same BB. (TRY is placed in the latest possible position, whereas LOOP is in the earliest possible position.) Reviewers: dschuff Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59751 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -579,7 +579,9 @@ void WebAssemblyCFGStackify::placeTryMarker(MachineBasicBlock &MBB) {
|
||||
// the END_TRY marker should go after that. Otherwise, the whole try-catch
|
||||
// is contained within this loop, so the END_TRY should go before that.
|
||||
if (MI.getOpcode() == WebAssembly::END_LOOP) {
|
||||
if (EndToBegin[&MI]->getParent()->getNumber() >= Header->getNumber())
|
||||
// For a LOOP to be after TRY, LOOP's BB should be after TRY's BB; if they
|
||||
// are in the same BB, LOOP is always before TRY.
|
||||
if (EndToBegin[&MI]->getParent()->getNumber() > Header->getNumber())
|
||||
BeforeSet.insert(&MI);
|
||||
#ifndef NDEBUG
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user