[llvm] r267037 - Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.

Kevin Enderby via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 12:49:29 PDT 2016


Author: enderby
Date: Thu Apr 21 14:49:29 2016
New Revision: 267037

URL: http://llvm.org/viewvc/llvm-project?rev=267037&view=rev
Log:
Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.

Showed up in running on a large binary with the missing section.  I could create a fake
test case if anyone really wants but the fix is pretty obvious.

rdar://25837034

Modified:
    llvm/trunk/tools/llvm-objdump/MachODump.cpp

Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=267037&r1=267036&r2=267037&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Apr 21 14:49:29 2016
@@ -5134,6 +5134,9 @@ static void print_image_info32(SectionRe
   struct objc_image_info32 o;
   const char *r;
 
+  if (S == SectionRef())
+    return;
+
   StringRef SectName;
   S.getName(SectName);
   DataRefImpl Ref = S.getRawDataRefImpl();




More information about the llvm-commits mailing list