summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-06-24 12:55:15 -0700
committerGitHub <noreply@github.com>2020-06-24 12:55:15 -0700
commiteae2ee3dff0c68cfa783f45ee3ced06f4b5aa47c (patch)
tree3960712103d31cd6322f1c5b63a611acd844b28b /src
parentdf660c241dcde92d634bb0704a449c8e1b4dd5a4 (diff)
downloadbinaryen-eae2ee3dff0c68cfa783f45ee3ced06f4b5aa47c.tar.gz
binaryen-eae2ee3dff0c68cfa783f45ee3ced06f4b5aa47c.tar.bz2
binaryen-eae2ee3dff0c68cfa783f45ee3ced06f4b5aa47c.zip
DWARF: Fix sequence_end emitting (#2929)
We must emit those, even if otherwise it looks like a line we can omit, as the ends of sequences have important meaning and dwarfdump will warn without them. Looks like fannkuch0 in the test suite already had an example of an incorrectly-omitted sequence_end, so no need for a new testcase. Verified that without this e.g. wasm2.test_exceptions with -g added will lead to a wasm that warns, but with this PR the debug_line section is reported as valid by dwarfdump.
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-debug.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm/wasm-debug.cpp b/src/wasm/wasm-debug.cpp
index 8ae7497ed..20c5dfb62 100644
--- a/src/wasm/wasm-debug.cpp
+++ b/src/wasm/wasm-debug.cpp
@@ -241,9 +241,10 @@ struct LineState {
}
bool needToEmit() {
- // Zero values imply we can ignore this line.
+ // Zero values imply we can ignore this line, unless it has something
+ // special we must emit.
// https://github.com/WebAssembly/debugging/issues/9#issuecomment-567720872
- return line != 0 && addr != 0;
+ return (line != 0 && addr != 0) || endSequence;
}
// Given an old state, emit the diff from it to this state into a new line