[PATCH] D93267: [lld-macho] Handle overflow beyond the 127 common encodings limit

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 19 12:14:51 PST 2020


int3 accepted this revision.
int3 added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: lld/MachO/UnwindInfoSection.cpp:197
+    while (wordsRemaining >= 1 && i < cuPtrVector.size()) {
+      auto *cuPtr = cuPtrVector[i];
+      if (cuPtr->functionAddress >= functionAddressMax) {
----------------
wouldn't hurt to address this lint


================
Comment at: lld/MachO/UnwindInfoSection.cpp:200-203
+      } else if (commonEncodingIndexes.find(cuPtr->encoding) !=
+                     commonEncodingIndexes.end() ||
+                 page.localEncodingIndexes.find(cuPtr->encoding) !=
+                     page.localEncodingIndexes.end()) {
----------------
could use `count()` instead of `find()` here


================
Comment at: lld/MachO/UnwindInfoSection.cpp:320-321
+          it = page.localEncodingIndexes.find(cuep->encoding);
+        *ep++ = (((*it).second << COMPRESSED_ENTRY_FUNC_OFFSET_BITS) |
+                 (cuep->functionAddress - functionAddressBase));
+      }
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93267



More information about the llvm-commits mailing list