[PATCH] D107035: [lld-macho] Change personalities entry type to Ptr to avoid overflowing uint32

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 22:10:02 PDT 2021


oontvoo created this revision.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
oontvoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

PR51262


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107035

Files:
  lld/MachO/UnwindInfoSection.cpp


Index: lld/MachO/UnwindInfoSection.cpp
===================================================================
--- lld/MachO/UnwindInfoSection.cpp
+++ lld/MachO/UnwindInfoSection.cpp
@@ -115,7 +115,7 @@
   std::vector<std::pair<compact_unwind_encoding_t, size_t>> commonEncodings;
   EncodingMap commonEncodingIndexes;
   // Indices of personality functions within the GOT.
-  std::vector<uint32_t> personalities;
+  std::vector<Ptr> personalities;
   SmallDenseMap<std::pair<InputSection *, uint64_t /* addend */>, Symbol *>
       personalityTable;
   std::vector<unwind_info_section_header_lsda_index_entry> lsdaEntries;
@@ -286,7 +286,7 @@
 template <class Ptr>
 static void
 encodePersonalities(const std::vector<CompactUnwindEntry<Ptr> *> &cuPtrVector,
-                    std::vector<uint32_t> &personalities) {
+                    std::vector<Ptr> &personalities) {
   for (CompactUnwindEntry<Ptr> *cu : cuPtrVector) {
     if (cu->personality == 0)
       continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107035.362635.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210729/335d780f/attachment.bin>


More information about the llvm-commits mailing list