[PATCH] D44285: Fix computeSymbolSizes SEGFAULT on invalid file

Teng Qin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 19:35:50 PST 2018


palmtenor updated this revision to Diff 137692.
palmtenor added a comment.

Format correctly


Repository:
  rL LLVM

https://reviews.llvm.org/D44285

Files:
  lib/Object/SymbolSize.cpp


Index: lib/Object/SymbolSize.cpp
===================================================================
--- lib/Object/SymbolSize.cpp
+++ lib/Object/SymbolSize.cpp
@@ -66,6 +66,10 @@
     Addresses.push_back(
         {O.symbol_end(), Address + Size, 0, getSectionID(O, Sec)});
   }
+
+  if (Addresses.empty())
+    return Ret;
+
   array_pod_sort(Addresses.begin(), Addresses.end(), compareAddress);
 
   // Compute the size as the gap to the next symbol


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44285.137692.patch
Type: text/x-patch
Size: 453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180309/dd0cf40f/attachment.bin>


More information about the llvm-commits mailing list