[PATCH] D138320: [lld-macho] Fix bug in CUE folding that resulted in wrong unwind table.

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 16:12:57 PST 2022


int3 added inline comments.


================
Comment at: lld/MachO/UnwindInfoSection.cpp:659
   const CompactUnwindEntry &cuEnd = cuEntries[cuIndices.back()];
-  iep->functionOffset =
-      cuEnd.functionAddress - in.header->addr + cuEnd.functionLength;
+  iep->functionOffset = finalEndingAddress - in.header->addr;
   iep->secondLevelPagesSectionOffset = 0;
----------------
jyknight wrote:
> int3 wrote:
> > I'm not entirely sure why, but this is what ld64 does
> Adding 1 does make sense. This value is the start of the "next function", so it's an exclusive bound, and you want the final byte of the function to actually be included in the range.
> 
That was my initial thought too, but shouldn't adding the length already make it an exclusive bound?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138320/new/

https://reviews.llvm.org/D138320



More information about the llvm-commits mailing list