[PATCH] D32652: Gracefully handle empty .drectve sections

Dave Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 11:53:54 PDT 2017


kastiglione updated this revision to Diff 97135.
kastiglione added a comment.

Move size check before name check


https://reviews.llvm.org/D32652

Files:
  tools/llvm-readobj/COFFDumper.cpp


Index: tools/llvm-readobj/COFFDumper.cpp
===================================================================
--- tools/llvm-readobj/COFFDumper.cpp
+++ tools/llvm-readobj/COFFDumper.cpp
@@ -1486,6 +1486,9 @@
     StringRef Contents;
     StringRef Name;
 
+    if (Section.getSize() == 0)
+      continue;
+
     error(Section.getName(Name));
     if (Name != ".drectve")
       continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32652.97135.patch
Type: text/x-patch
Size: 388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170428/0feaf32e/attachment.bin>


More information about the llvm-commits mailing list