diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2017-12-11 18:22:47 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2017-12-11 18:22:47 +0000 |
commit | ba915897daebc34fa4e988e3e4c401ef122d68ce (patch) | |
tree | 1a176391c7481de445c0ed78c3360c1ebdf9f495 /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | |
parent | 6c4835978a1ece85d1ea26bddc9dcc73876f6b10 (diff) | |
download | bcm5719-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/DWARFContext.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 414959c7a5c..a5defa90eb3 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -672,7 +672,8 @@ getAccelTable(std::unique_ptr<DWARFAcceleratorTable> &Cache, DWARFDataExtractor AccelSection(Obj, Section, IsLittleEndian, 0); DataExtractor StrData(StringSection, IsLittleEndian, 0); Cache.reset(new DWARFAcceleratorTable(AccelSection, StrData)); - Cache->extract(); + if (Error E = Cache->extract()) + llvm::consumeError(std::move(E)); return *Cache; } |