[lld] [lld][MachO] Fix symbol insertion in `transplantSymbolsAtOffset` (PR #120737)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 09:35:50 PST 2024


bjope wrote:

> Nice idea with the assert. Adding `assert(llvm::is_sorted(toIsec->symbols) && "Symbols should still be sorted at exit."); ` at end of transplantSymbolsAtOffset seem to result in assertion failure for the `lld/test/MachO/symtab.s`.
> 
> So that might be enough, considering that there already is a test case that would trigger such an assert.

Ooops, was a bit fast. That is_sorted call needs to supply the comparison function.
Guess the problem is to understand which comparison function to provide given that the fault is in the comparison function :-)

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


More information about the llvm-commits mailing list