diff options
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 5faa8b2f5..fb55417d5 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1963,6 +1963,8 @@ void FunctionValidator::visitRefNull(RefNull* curr) { shouldBeTrue(getModule()->features.hasReferenceTypes(), curr, "ref.null requires reference-types to be enabled"); + shouldBeTrue( + curr->type.isNullable(), curr, "ref.null types must be nullable"); } void FunctionValidator::visitRefIsNull(RefIsNull* curr) { @@ -2158,10 +2160,10 @@ void FunctionValidator::visitCallRef(CallRef* curr) { shouldBeTrue(getModule()->features.hasTypedFunctionReferences(), curr, "call_ref requires typed-function-references to be enabled"); - shouldBeTrue(curr->target->type.isFunction(), - curr, - "call_ref target must be a function reference"); 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().getSignature()); } |