dwarfdump: Add error checking to fix the buildbots/correctness
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 12 Nov 2015 01:57:33 +0000 (01:57 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 12 Nov 2015 01:57:33 +0000 (01:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252845 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARF/DWARFContext.cpp

index d6ed6f842070c87cc1ba503d081a210c996ffd09..ac92a632b581111e27470e5c26073984c92905f8 100644 (file)
@@ -161,8 +161,8 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
     DataExtractor CUIndexData(getCUIndexSection(), isLittleEndian(),
                               savedAddressByteSize);
     DWARFUnitIndex CUIndex;
     DataExtractor CUIndexData(getCUIndexSection(), isLittleEndian(),
                               savedAddressByteSize);
     DWARFUnitIndex CUIndex;
-    CUIndex.parse(CUIndexData);
-    CUIndex.dump(OS);
+    if (CUIndex.parse(CUIndexData))
+      CUIndex.dump(OS);
   }
 
   if (DumpType == DIDT_All || DumpType == DIDT_TUIndex) {
   }
 
   if (DumpType == DIDT_All || DumpType == DIDT_TUIndex) {
@@ -170,8 +170,8 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
     DataExtractor TUIndexData(getTUIndexSection(), isLittleEndian(),
                               savedAddressByteSize);
     DWARFUnitIndex TUIndex;
     DataExtractor TUIndexData(getTUIndexSection(), isLittleEndian(),
                               savedAddressByteSize);
     DWARFUnitIndex TUIndex;
-    TUIndex.parse(TUIndexData);
-    TUIndex.dump(OS);
+    if (TUIndex.parse(TUIndexData))
+      TUIndex.dump(OS);
   }
 
   if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) {
   }
 
   if (DumpType == DIDT_All || DumpType == DIDT_LineDwo) {