summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-debug.cpp')
-rw-r--r--src/wasm/wasm-debug.cpp2
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()));