[all-commits] [llvm/llvm-project] 56bd31: [MachO] Don't fold compact unwind entries with LSDA

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Tue Aug 30 00:35:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 56bd3185cdd8d79731acd6c75bf41869284a12ed
      https://github.com/llvm/llvm-project/commit/56bd3185cdd8d79731acd6c75bf41869284a12ed
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2022-08-30 (Tue, 30 Aug 2022)

  Changed paths:
    M lld/MachO/UnwindInfoSection.cpp
    A lld/test/MachO/compact-unwind-lsda-folding.s

  Log Message:
  -----------
  [MachO] Don't fold compact unwind entries with LSDA

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.

Reviewed By: #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D132845




More information about the All-commits mailing list