diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/literal.cpp | 3 | ||||
-rw-r--r-- | src/wasm/wasm-validator.cpp | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index 20b6b7234..a49fa1b62 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -445,7 +445,8 @@ bool Literal::operator==(const Literal& other) const { if (type.isData()) { return gcData == other.gcData; } - if (type.getHeapType() == HeapType::i31) { + assert(type.getHeapType().isBasic()); + if (type.getHeapType().getBasic(Unshared) == HeapType::i31) { return i32 == other.i32; } WASM_UNREACHABLE("unexpected type"); diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index e18191bea..29e7a2c9c 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2306,6 +2306,12 @@ void FunctionValidator::visitRefEq(RefEq* curr) { eqref, curr->right, "ref.eq's right argument should be a subtype of eqref"); + if (curr->left->type.isRef() && curr->right->type.isRef()) { + shouldBeEqual(curr->left->type.getHeapType().getShared(), + curr->right->type.getHeapType().getShared(), + curr, + "ref.eq operands must have the same shareability"); + } } void FunctionValidator::visitTableGet(TableGet* curr) { |