diff --git a/test/common/wasm/wasm-interpreter.cc b/test/common/wasm/wasm-interpreter.cc index 6310c90fb4..6820e20449 100644 --- a/test/common/wasm/wasm-interpreter.cc +++ b/test/common/wasm/wasm-interpreter.cc @@ -2034,6 +2034,10 @@ class WasmInterpreterInternals { *len += 1; break; case kExprI32AtomicWait: { + if (!module()->has_shared_memory) { + DoTrap(kTrapUnreachable, pc); + return false; + } int32_t val; int64_t timeout; uint32_t buffer_offset; @@ -2050,6 +2054,10 @@ class WasmInterpreterInternals { break; } case kExprI64AtomicWait: { + if (!module()->has_shared_memory) { + DoTrap(kTrapUnreachable, pc); + return false; + } int64_t val; int64_t timeout; uint32_t buffer_offset; @@ -2072,6 +2080,10 @@ class WasmInterpreterInternals { &buffer_offset, &val)) { return false; } + if (!module()->has_shared_memory) { + Push(WasmValue(0)); + break; + } HandleScope handle_scope(isolate_); Handle array_buffer( instance_object_->memory_object().array_buffer(), isolate_);