summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2017-12-11 18:22:47 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2017-12-11 18:22:47 +0000
commitba915897daebc34fa4e988e3e4c401ef122d68ce (patch)
tree1a176391c7481de445c0ed78c3360c1ebdf9f495 /llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
parent6c4835978a1ece85d1ea26bddc9dcc73876f6b10 (diff)
downloadbcm5719-llvm-ba915897daebc34fa4e988e3e4c401ef122d68ce.tar.gz
bcm5719-llvm-ba915897daebc34fa4e988e3e4c401ef122d68ce.zip
[dwarfdump] Fix off-by-one bug in accelerator table extractor.
This fixes a bug where the verifier was complaining about empty accelerator tables. When the table is empty, its size is not a valid offset as it points after the end of the section. This patch also makes the extractor return llvm:Error instead of bool for better error reporting in the verifier. Differential revision: https://reviews.llvm.org/D41063 rdar://35932007 llvm-svn: 320399
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 8e07bb3c462..3d473698b46 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -686,8 +686,8 @@ unsigned DWARFVerifier::verifyAccelTable(const DWARFSection *AccelSection,
}
// Verify that the section is not too short.
- if (!AccelTable.extract()) {
- error() << "Section is smaller than size described in section header.\n";
+ if (Error E = AccelTable.extract()) {
+ error() << toString(std::move(E)) << '\n';
return 1;
}
OpenPOWER on IntegriCloud