summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm/wasm-validator.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index bebb3eabe..c0b3e9292 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2375,6 +2375,8 @@ void FunctionValidator::visitRefTest(RefTest* curr) {
HeapType(),
curr,
"static ref.test must set intendedType field");
+ shouldBeTrue(
+ !curr->intendedType.isBasic(), curr, "ref.test must test a non-basic");
}
}
@@ -2399,6 +2401,8 @@ void FunctionValidator::visitRefCast(RefCast* curr) {
HeapType(),
curr,
"static ref.cast must set intendedType field");
+ shouldBeTrue(
+ !curr->intendedType.isBasic(), curr, "ref.cast must cast to a non-basic");
}
}
@@ -2427,6 +2431,9 @@ void FunctionValidator::visitBrOn(BrOn* curr) {
HeapType(),
curr,
"static br_on_cast* must set intendedType field");
+ shouldBeTrue(!curr->intendedType.isBasic(),
+ curr,
+ "br_on_cast* must cast to a non-basic");
}
} else {
shouldBeTrue(curr->rtt == nullptr, curr, "non-cast BrOn must not have rtt");