summaryrefslogtreecommitdiff
path: root/third_party/llvm-project/DWARFVisitor.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-03-04 17:37:22 -0800
committerGitHub <noreply@github.com>2020-03-04 17:37:22 -0800
commit5034bf1dd28c9066422680cf516513af92bbbb8a (patch)
treee188019ba0599b54749b1419cff565f401b22d70 /third_party/llvm-project/DWARFVisitor.cpp
parent57a81a04f7a49593438dcae4ca8cbad8e465dc2e (diff)
downloadbinaryen-5034bf1dd28c9066422680cf516513af92bbbb8a.tar.gz
binaryen-5034bf1dd28c9066422680cf516513af92bbbb8a.tar.bz2
binaryen-5034bf1dd28c9066422680cf516513af92bbbb8a.zip
DWARF: Ignore a compile unit with no abbreviations (#2678)
Such a module can't have valid DIEs, since we have no way to interpret them. Also check if DWARF sections from LLVM have contents - when they are empty the section may exist but have a null for its data. Fixes #2673
Diffstat (limited to 'third_party/llvm-project/DWARFVisitor.cpp')
-rw-r--r--third_party/llvm-project/DWARFVisitor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/llvm-project/DWARFVisitor.cpp b/third_party/llvm-project/DWARFVisitor.cpp
index 44bb33b47..ba3d1e0c5 100644
--- a/third_party/llvm-project/DWARFVisitor.cpp
+++ b/third_party/llvm-project/DWARFVisitor.cpp
@@ -59,6 +59,11 @@ template <typename T> void DWARFYAML::VisitorImpl<T>::traverseDebugInfo() {
DebugInfo.AbbrevDecls[AbbrevEnd].Code) {
AbbrevEnd++;
}
+ // XXX BINARYEN If there are no abbreviations, there is nothing to
+ // do in this unit.
+ if (AbbrevStart == AbbrevEnd) {
+ continue;
+ }
onStartCompileUnit(Unit);
if (Unit.Entries.empty()) { // XXX BINARYEN
continue;