From 5034bf1dd28c9066422680cf516513af92bbbb8a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 4 Mar 2020 17:37:22 -0800 Subject: 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 --- third_party/llvm-project/DWARFVisitor.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'third_party/llvm-project/DWARFVisitor.cpp') 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 void DWARFYAML::VisitorImpl::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; -- cgit v1.2.3