[llvm] [BOLT] Fix local out-of-range stub issue that leads to infinite loop in LongJmp pass (PR #73918)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 02:50:08 PST 2023
================
@@ -202,10 +202,22 @@ LongJmpPass::replaceTargetWithStub(BinaryBasicBlock &BB, MCInst &Inst,
}
} else if (LocalStubsIter != Stubs.end() &&
LocalStubsIter->second.count(TgtBB)) {
- // If we are replacing a local stub (because it is now out of range),
- // use its target instead of creating a stub to jump to another stub
+ // The TgtBB and TgtSym now are the local out-of-range stub and its label.
+ // So, we are attempting to restore BB to its previous state without using
+ // this stub.
TgtSym = BC.MIB->getTargetSymbol(*TgtBB->begin());
- TgtBB = BB.getSuccessor(TgtSym, BI);
+ assert(TgtSym && "First instruction is expected to be a branch.");
----------------
linsinan1995 wrote:
Thanks. Changed.
https://github.com/llvm/llvm-project/pull/73918
More information about the llvm-commits
mailing list