summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm/wasm-validator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 1ad1380c9..65fcc7a9d 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -2324,10 +2324,11 @@ void FunctionValidator::visitCallRef(CallRef* curr) {
curr,
"call_ref requires typed-function-references to be enabled");
if (curr->target->type != Type::unreachable) {
- shouldBeTrue(curr->target->type.isFunction(),
- curr,
- "call_ref target must be a function reference");
- validateCallParamsAndResult(curr, curr->target->type.getHeapType());
+ if (shouldBeTrue(curr->target->type.isFunction(),
+ curr,
+ "call_ref target must be a function reference")) {
+ validateCallParamsAndResult(curr, curr->target->type.getHeapType());
+ }
}
}