[llvm] [BOLT] Fix local out-of-range stub issue that leads to infinite loop in LongJmp pass (PR #73918)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 11:53:30 PST 2023


https://github.com/rafaelauler approved this pull request.

Thanks a lot for this fix, @linsinan1995. The only thing I would do differently is to add an assert that TgtSym is not null after line 208  "TgtSym = ....getTargetSymbol(*TgtBB->begin())", so we are not taken by surprise if we change the contents of a stub and all of a sudden the first instruction is not the  branch anymore, in which case we will silently return nullptr to TgtSym and break LongJmp. There are a lot of assumptions in that line, which, admittedly, is part of the original code and not your code. 

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


More information about the llvm-commits mailing list