diff options
author | Alon Zakai <azakai@google.com> | 2020-03-04 17:37:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 17:37:22 -0800 |
commit | 5034bf1dd28c9066422680cf516513af92bbbb8a (patch) | |
tree | e188019ba0599b54749b1419cff565f401b22d70 /src | |
parent | 57a81a04f7a49593438dcae4ca8cbad8e465dc2e (diff) | |
download | binaryen-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 'src')
-rw-r--r-- | src/wasm/wasm-debug.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-debug.cpp b/src/wasm/wasm-debug.cpp index 50a04a6e6..286b63e69 100644 --- a/src/wasm/wasm-debug.cpp +++ b/src/wasm/wasm-debug.cpp @@ -56,7 +56,7 @@ struct BinaryenDWARFInfo { BinaryenDWARFInfo(const Module& wasm) { // Get debug sections from the wasm. for (auto& section : wasm.userSections) { - if (Name(section.name).startsWith(".debug_")) { + if (Name(section.name).startsWith(".debug_") && section.data.data()) { // TODO: efficiency sections[section.name.substr(1)] = llvm::MemoryBuffer::getMemBufferCopy( llvm::StringRef(section.data.data(), section.data.size())); |