summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/Win64EHDumper.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-20 03:23:55 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-20 03:23:55 +0000
commitfb3acd62162b29bb736ddeed4f21e173cbc3b1f3 (patch)
tree61e4337d742d5b5ca45f87c39dfaff483ce8ca50 /llvm/tools/llvm-readobj/Win64EHDumper.cpp
parent724d4b43f4b5874bfef3ab8cf41cb011755af39d (diff)
downloadbcm5719-llvm-fb3acd62162b29bb736ddeed4f21e173cbc3b1f3.tar.gz
bcm5719-llvm-fb3acd62162b29bb736ddeed4f21e173cbc3b1f3.zip
llvm-readobj: call exit(1) on error.
llvm-readobj exists for testing llvm. We can safely stop the program the first time we know the input in corrupted. This is in preparation for making it handle a few more broken files. llvm-svn: 242656
Diffstat (limited to 'llvm/tools/llvm-readobj/Win64EHDumper.cpp')
-rw-r--r--llvm/tools/llvm-readobj/Win64EHDumper.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/tools/llvm-readobj/Win64EHDumper.cpp b/llvm/tools/llvm-readobj/Win64EHDumper.cpp
index f57eea20e2d..076f137d6ee 100644
--- a/llvm/tools/llvm-readobj/Win64EHDumper.cpp
+++ b/llvm/tools/llvm-readobj/Win64EHDumper.cpp
@@ -284,11 +284,11 @@ void Dumper::printRuntimeFunction(const Context &Ctx,
const coff_section *XData;
uint64_t Offset;
- if (error(resolveRelocation(Ctx, Section, SectionOffset + 8, XData, Offset)))
- return;
+ resolveRelocation(Ctx, Section, SectionOffset + 8, XData, Offset);
ArrayRef<uint8_t> Contents;
- if (error(Ctx.COFF.getSectionContents(XData, Contents)) || Contents.empty())
+ error(Ctx.COFF.getSectionContents(XData, Contents));
+ if (Contents.empty())
return;
Offset = Offset + RF.UnwindInfoOffset;
@@ -302,15 +302,15 @@ void Dumper::printRuntimeFunction(const Context &Ctx,
void Dumper::printData(const Context &Ctx) {
for (const auto &Section : Ctx.COFF.sections()) {
StringRef Name;
- if (error(Section.getName(Name)))
- continue;
+ Section.getName(Name);
if (Name != ".pdata" && !Name.startswith(".pdata$"))
continue;
const coff_section *PData = Ctx.COFF.getCOFFSection(Section);
ArrayRef<uint8_t> Contents;
- if (error(Ctx.COFF.getSectionContents(PData, Contents)) || Contents.empty())
+ error(Ctx.COFF.getSectionContents(PData, Contents));
+ if (Contents.empty())
continue;
const RuntimeFunction *Entries =
OpenPOWER on IntegriCloud