diff options
author | Alon Zakai <azakai@google.com> | 2020-01-06 16:01:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-06 16:01:38 -0800 |
commit | 0dab8853d60e2e61a749b93056faae35e7ec6ce6 (patch) | |
tree | 6884d42f748e332d7ca3e813d655149b88fdf717 /src | |
parent | 44c3c2d4e71686d42b7eff8ab9c554f83a9fe71e (diff) | |
download | binaryen-0dab8853d60e2e61a749b93056faae35e7ec6ce6.tar.gz binaryen-0dab8853d60e2e61a749b93056faae35e7ec6ce6.tar.bz2 binaryen-0dab8853d60e2e61a749b93056faae35e7ec6ce6.zip |
DCE at the end of wasm2js (#2574)
By doing so we ensure that our calls to convert wasm
types to JS types never try to convert an unreachable.
Fixes #2558
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm2js.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h index 1adde23b8..398b81f43 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -329,6 +329,9 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) { runner.add("reorder-locals"); runner.add("vacuum"); runner.add("remove-unused-module-elements"); + // DCE at the end to make sure all IR nodes have valid types for conversion + // to JS, and not unreachable. + runner.add("dce"); runner.setDebug(flags.debug); runner.run(); } |