Return ErrorOr from getSection.
[oota-llvm.git] / tools / llvm-readobj / ARMEHABIPrinter.h
index 55d10b151de381a0d313c94926a05848fbd50458..dd2490d503db44ae3261875e4254bb478acad47f 100644 (file)
@@ -377,7 +377,10 @@ PrinterContext<ET>::FindExceptionTable(unsigned IndexSectionIndex,
           std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
               ELF->getRelocationSymbol(&Sec, &RelA);
 
-          return ELF->getSection(Symbol.second);
+          ErrorOr<const Elf_Shdr *> Ret = ELF->getSection(Symbol.second);
+          if (std::error_code EC = Ret.getError())
+            report_fatal_error(EC.message());
+          return *Ret;
         }
       }
     }