diff options
author | Alon Zakai <azakai@google.com> | 2022-09-01 10:30:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 10:30:43 -0700 |
commit | 7c5f6c2aca80d70cf05fc83739f87ff23c75a1e3 (patch) | |
tree | c4713e7498eb967cbd772cab96812c710c42114f /src | |
parent | 0821cd10da9ca81371688e132ed17164f23ea889 (diff) | |
download | binaryen-7c5f6c2aca80d70cf05fc83739f87ff23c75a1e3.tar.gz binaryen-7c5f6c2aca80d70cf05fc83739f87ff23c75a1e3.tar.bz2 binaryen-7c5f6c2aca80d70cf05fc83739f87ff23c75a1e3.zip |
[Wasm GC] Fix evaluateKindCheck() on new externalize/internalize operations (#5000)
Also add testing that they pass through the full optimizer.
Fixes #4999
Drive-by fixes to the text in the assertions, which was copy-pasted.
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/gc-type-utils.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ir/gc-type-utils.h b/src/ir/gc-type-utils.h index cec4490e2..abe5f2dfc 100644 --- a/src/ir/gc-type-utils.h +++ b/src/ir/gc-type-utils.h @@ -100,7 +100,7 @@ inline EvaluationResult evaluateKindCheck(Expression* curr) { expected = I31; break; default: - WASM_UNREACHABLE("unhandled BrOn"); + WASM_UNREACHABLE("unhandled RefIs"); } child = is->value; } else if (auto* as = curr->dynCast<RefAs>()) { @@ -117,8 +117,12 @@ inline EvaluationResult evaluateKindCheck(Expression* curr) { case RefAsI31: expected = I31; break; + case ExternInternalize: + case ExternExternalize: + // These instructions can never be removed. + return Unknown; default: - WASM_UNREACHABLE("unhandled BrOn"); + WASM_UNREACHABLE("unhandled RefAs"); } child = as->value; } else { |