summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp6
1 files changed, 6 insertions, 0 deletions
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) {