diff options
author | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2024-08-21 00:43:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 15:43:25 -0700 |
commit | 340ad71810484c279b1a36a9a7e458c9b18855b9 (patch) | |
tree | 4167b08dea6f5ffcdb975d90eb6f3c7925f628e0 /src/passes/DeadCodeElimination.cpp | |
parent | 2c9c74d8b64e1776c6c374af8631995b0be606f1 (diff) | |
download | binaryen-340ad71810484c279b1a36a9a7e458c9b18855b9.tar.gz binaryen-340ad71810484c279b1a36a9a7e458c9b18855b9.tar.bz2 binaryen-340ad71810484c279b1a36a9a7e458c9b18855b9.zip |
[Exceptions] Finish interpreter + optimizer support for try_table. (#6814)
* Add interpreter support for exnref values.
* Fix optimization passes to support try_table.
* Enable the interpreter (but not in V8, see code) on exceptions.
Diffstat (limited to 'src/passes/DeadCodeElimination.cpp')
-rw-r--r-- | src/passes/DeadCodeElimination.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp index 996133ad5..f8acde7b0 100644 --- a/src/passes/DeadCodeElimination.cpp +++ b/src/passes/DeadCodeElimination.cpp @@ -185,6 +185,12 @@ struct DeadCodeElimination tryy->body->type == Type::unreachable && allCatchesUnreachable) { typeUpdater.changeType(tryy, Type::unreachable); } + } else if (auto* tryTable = curr->dynCast<TryTable>()) { + // try_table can finish normally only if its body finishes normally. + if (tryTable->type != Type::unreachable && + tryTable->body->type == Type::unreachable) { + typeUpdater.changeType(tryTable, Type::unreachable); + } } else { WASM_UNREACHABLE("unimplemented DCE control flow structure"); } |