Skip to content

Commit 6c0fc9b

Browse files
committed
[threads] Fix typo in ref.i31_shared validation
And tighten up the test so it would have caught the problem.
1 parent dda47fc commit 6c0fc9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wasm/wasm-validator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2729,7 +2729,7 @@ void FunctionValidator::visitRefI31(RefI31* curr) {
27292729
getModule()->features.hasGC(), curr, "ref.i31 requires gc [--enable-gc]");
27302730
if (curr->type.isRef() && curr->type.getHeapType().isShared()) {
27312731
shouldBeTrue(
2732-
getModule()->features.hasGC(),
2732+
getModule()->features.hasSharedEverything(),
27332733
curr,
27342734
"ref.i31_shared requires shared-everything [--enable-shared-everything]");
27352735
}

test/lit/validation/shared-ref-i31.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;; Test that ref.i31_shared requires shared-everything threads
22

3-
;; RUN: not wasm-opt %s 2>&1 | filecheck %s --check-prefix NO-SHARED
3+
;; RUN: not wasm-opt %s -all --disable-shared-everything 2>&1 | filecheck %s --check-prefix NO-SHARED
44
;; RUN: wasm-opt %s --enable-reference-types --enable-gc --enable-shared-everything -o - -S | filecheck %s --check-prefix SHARED
55

66
;; NO-SHARED: ref.i31_shared requires shared-everything [--enable-shared-everything]

0 commit comments

Comments
 (0)