[llvm] [BOLT] a local out-of-range stub might lead to infinite loop in LongJmp (PR #73918)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 01:35:41 PST 2023


================
@@ -202,10 +202,31 @@ 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 BB and label of an out-of-range
+    // local stub. We replace with the target of the local stub instead
+    // of creating a stub to jump to another stub.
+    // e.g.
+    // change the out-of-range stub
----------------
yota9 wrote:

Probably just text would be more useful here, just add smth about that we need to also return BB's successors to previous state i.e. to the target of stub in case it was a local stub.

https://github.com/llvm/llvm-project/pull/73918


More information about the llvm-commits mailing list