[PATCH] D132845: [MachO] Don't fold compact unwind entries with LSDA

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 04:19:53 PDT 2022


smeenai created this revision.
Herald added a reviewer: ributzka.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Folding them will cause the unwinder to compute the incorrect function
start address for the folded entries, which in turn will cause the
personality function to interpret the LSDA incorrectly and break
exception handling.

You can verify the end-to-end flow by creating a simple C++ file:

  void h();
  int main() { h(); }

and then linking this file against the liblsda.dylib produced by the
test case added here. Before this change, running the resulting program
would result in a program termination with an uncaught exception.
Afterwards, it works correctly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132845

Files:
  lld/MachO/UnwindInfoSection.cpp
  lld/test/MachO/compact-unwind-lsda-folding.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132845.456303.patch
Type: text/x-patch
Size: 11022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220829/f8fbad86/attachment.bin>


More information about the llvm-commits mailing list