[threads] Fix typo in ref.i31_shared validation And tighten up the test so it would have caught the problem.
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index fd78efe..9994adf 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp
@@ -2729,7 +2729,7 @@ getModule()->features.hasGC(), curr, "ref.i31 requires gc [--enable-gc]"); if (curr->type.isRef() && curr->type.getHeapType().isShared()) { shouldBeTrue( - getModule()->features.hasGC(), + getModule()->features.hasSharedEverything(), curr, "ref.i31_shared requires shared-everything [--enable-shared-everything]"); }
diff --git a/test/lit/validation/shared-ref-i31.wast b/test/lit/validation/shared-ref-i31.wast index 222bd05..aaab2f4 100644 --- a/test/lit/validation/shared-ref-i31.wast +++ b/test/lit/validation/shared-ref-i31.wast
@@ -1,6 +1,6 @@ ;; Test that ref.i31_shared requires shared-everything threads -;; RUN: not wasm-opt %s 2>&1 | filecheck %s --check-prefix NO-SHARED +;; RUN: not wasm-opt %s -all --disable-shared-everything 2>&1 | filecheck %s --check-prefix NO-SHARED ;; RUN: wasm-opt %s --enable-reference-types --enable-gc --enable-shared-everything -o - -S | filecheck %s --check-prefix SHARED ;; NO-SHARED: ref.i31_shared requires shared-everything [--enable-shared-everything]