[PATCH] D147505: [lld-macho] Check if DWARF offset is too large for compact unwind

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 06:20:01 PDT 2023


int3 added inline comments.


================
Comment at: lld/MachO/UnwindInfoSection.cpp:351
+      // from the hint offset until the end of the section. So if the offset is
+      // too large to be encoded, we simply encode the maximum possible value.
+      uint64_t dwarfOffsetHint =
----------------
Upon closer inspection I think this only works if the hint points to a valid CFI record start, otherwise the unwinder will just repeatedly fail to parse all CFI entries until the end of the section, then start again from the beginning. So I'm going to encode a zero instead.

I would like to eventually figure out how to build and test against a custom copy of libunwind to verify, but I'd like to get this fix out first. I believe emitting a zero here is safe.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147505



More information about the llvm-commits mailing list