summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-01-11 09:31:15 -0800
committerGitHub <noreply@github.com>2023-01-11 09:31:15 -0800
commitad7a6dc59e07946e857b9f125d6e95d920df6bc7 (patch)
tree6543b8f7d6b69328bfe7c3260f307e173d78b088 /src
parent5032e958808ef584cfd7e4be35f419b4d35488ac (diff)
downloadbinaryen-ad7a6dc59e07946e857b9f125d6e95d920df6bc7.tar.gz
binaryen-ad7a6dc59e07946e857b9f125d6e95d920df6bc7.tar.bz2
binaryen-ad7a6dc59e07946e857b9f125d6e95d920df6bc7.zip
[Wasm GC] Handle an unreachable br_on_cast_fail in DCE (#5418)
Without this we hit an assertion on unreachable not being a heap type.
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 4a72f6ea6..fa1351541 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1014,7 +1014,10 @@ Type BrOn::getSentType() {
return castType;
}
case BrOnCastFail:
- // The same as the result type of br_on_cast.
+ // The same as the result type of br_on_cast (if reachable).
+ if (ref->type == Type::unreachable) {
+ return Type::unreachable;
+ }
if (castType.isNullable()) {
return Type(ref->type.getHeapType(), NonNullable);
} else {