summaryrefslogtreecommitdiff
path: root/src/passes/Vacuum.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2021-12-06 14:09:35 -0800
committerGitHub <noreply@github.com>2021-12-06 14:09:35 -0800
commit9659f9b07c1196447edee68fe04c8d7dd2480652 (patch)
tree8e29497d0d4820abc6707044b9ec709f40867989 /src/passes/Vacuum.cpp
parent80ba2559f08422e60281ebf15856676b81f22a76 (diff)
downloadbinaryen-9659f9b07c1196447edee68fe04c8d7dd2480652.tar.gz
binaryen-9659f9b07c1196447edee68fe04c8d7dd2480652.tar.bz2
binaryen-9659f9b07c1196447edee68fe04c8d7dd2480652.zip
[EH] Support try-delegate in EffectAnalyzer (#4368)
This adds support for try-delegate in `EffectAnalyzer`. Without this support, the expresion below has been incorrectly classified as "cannot throw", because the previous code considered everything inside `try`-`catch_all` as "cannot throw". This is not the case when there is a `delegate` that can bypass the `catch_all`. ```wasm try $l0 try try throw $e delegate $l0 catch_all end end
Diffstat (limited to 'src/passes/Vacuum.cpp')
-rw-r--r--src/passes/Vacuum.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp
index abd54f334..6adab04e9 100644
--- a/src/passes/Vacuum.cpp
+++ b/src/passes/Vacuum.cpp
@@ -360,7 +360,7 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> {
void visitTry(Try* curr) {
// If try's body does not throw, the whole try-catch can be replaced with
// the try's body.
- if (!EffectAnalyzer(getPassOptions(), *getModule(), curr->body).throws) {
+ if (!EffectAnalyzer(getPassOptions(), *getModule(), curr->body).throws()) {
replaceCurrent(curr->body);
for (auto* catchBody : curr->catchBodies) {
typeUpdater.noteRecursiveRemoval(catchBody);