diff options
author | Thomas Lively <tlively@google.com> | 2024-07-18 14:43:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-18 11:43:23 -0700 |
commit | fd867a3865d079b7f9c8ec1c7fc6d02a4de28b4c (patch) | |
tree | 0a26805a992880afdbd64162d31045b6ae998a04 /src | |
parent | b91966f7999175e8b03da9a7a9dcdb07e4749fb1 (diff) | |
download | binaryen-fd867a3865d079b7f9c8ec1c7fc6d02a4de28b4c.tar.gz binaryen-fd867a3865d079b7f9c8ec1c7fc6d02a4de28b4c.tar.bz2 binaryen-fd867a3865d079b7f9c8ec1c7fc6d02a4de28b4c.zip |
[threads] ref.i31_shared requires shared-everything in validation (#6767)
Diffstat (limited to 'src')
-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, |