diff options
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 29e7a2c9c..4e167df56 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2727,6 +2727,12 @@ void FunctionValidator::visitCallRef(CallRef* curr) { void FunctionValidator::visitRefI31(RefI31* curr) { shouldBeTrue( getModule()->features.hasGC(), curr, "ref.i31 requires gc [--enable-gc]"); + if (curr->type.isRef() && curr->type.getHeapType().isShared()) { + shouldBeTrue( + getModule()->features.hasSharedEverything(), + curr, + "ref.i31_shared requires shared-everything [--enable-shared-everything]"); + } shouldBeSubType(curr->value->type, Type::i32, curr->value, |