[llvm] r256108 - [llvm-objdump] Fail early if we can't parse the object header.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 19 14:09:41 PST 2015


Author: davide
Date: Sat Dec 19 16:09:40 2015
New Revision: 256108

URL: http://llvm.org/viewvc/llvm-project?rev=256108&view=rev
Log:
[llvm-objdump] Fail early if we can't parse the object header.

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

Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=256108&r1=256107&r2=256108&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Sat Dec 19 16:09:40 2015
@@ -1527,13 +1527,14 @@ static void printFaultMaps(const ObjectF
 }
 
 static void printPrivateFileHeader(const ObjectFile *o) {
-  if (o->isELF()) {
+  if (o->isELF())
     printELFFileHeader(o);
-  } else if (o->isCOFF()) {
+  else if (o->isCOFF())
     printCOFFFileHeader(o);
-  } else if (o->isMachO()) {
+  else if (o->isMachO())
     printMachOFileHeader(o);
-  }
+  else
+    report_fatal_error("Invalid/Unsupported object file format");
 }
 
 static void DumpObject(const ObjectFile *o) {




More information about the llvm-commits mailing list