diff options
author | Alon Zakai <azakai@google.com> | 2021-02-19 19:19:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 11:19:56 -0800 |
commit | e24c1f0c826db6dcd63fc015f961919657accce5 (patch) | |
tree | f504fd0d227464befcb044b166ecbab056305cda /test/passes/dwarf_with_exceptions.cpp | |
parent | b6c094c8760b3c3e7ffbc54c46c6329b22d88cfe (diff) | |
download | binaryen-e24c1f0c826db6dcd63fc015f961919657accce5.tar.gz binaryen-e24c1f0c826db6dcd63fc015f961919657accce5.tar.bz2 binaryen-e24c1f0c826db6dcd63fc015f961919657accce5.zip |
[Wasm Exceptions] Fix binary parsing of a normal break to a try in a singleton (#3581)
The fix here is to remove the code with
// maybe we don't need a block here?
That would remove a try's block if we thought it wasn't needed. However,
it just checked for exception branches, but not normal branches, which are
also possible.
At that location, we don't have a good way to find out if the block has other
branches to it aside from scanning its contents. So this PR just gives up on
doing so, which means we add an unnecessary block if the optimizer is not
run. If this matters we could make the binary parser more complicated by
remembering whether a block had branches in the past, but I'm not sure if
it's worth it.
Diffstat (limited to 'test/passes/dwarf_with_exceptions.cpp')
-rw-r--r-- | test/passes/dwarf_with_exceptions.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/passes/dwarf_with_exceptions.cpp b/test/passes/dwarf_with_exceptions.cpp index 283b30064..5854202e1 100644 --- a/test/passes/dwarf_with_exceptions.cpp +++ b/test/passes/dwarf_with_exceptions.cpp @@ -7,8 +7,12 @@ void dwarf_with_exceptions() { } } // How to generate dwarf_with_exceptions.wasm: -// $ clang++ -std=c++14 --target=wasm32-unknown-unknown -g -fwasm-exceptions -Xclang -disable-O0-optnone -c -S -emit-llvm dwarf_with_exceptions.cpp -o temp.ll +// $ clang++ -std=c++14 --target=wasm32-unknown-unknown -g -fwasm-exceptions \ +// -Xclang -disable-O0-optnone -c -S -emit-llvm +// dwarf_with_exceptions.cpp -o temp.ll // $ opt -S -mem2reg -simplifycfg temp.ll -o dwarf_with_exceptions.ll // Remove some personal info from dwarf_with_exceptions.ll -// $ llc -exception-model=wasm -mattr=+exception-handling -filetype=obj dwarf_with_exceptions.ll -o dwarf_with_exceptions.o -// $ wasm-ld --no-entry --no-gc-sections --allow-undefined dwarf_with_exceptions.o -o dwarf_with_exceptions.wasm +// $ llc -exception-model=wasm -mattr=+exception-handling -filetype=obj \ +// dwarf_with_exceptions.ll -o dwarf_with_exceptions.o +// $ wasm-ld --no-entry --no-gc-sections --allow-undefined \ +// dwarf_with_exceptions.o -o dwarf_with_exceptions.wasm |