diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index eb2f949b24a..143baee416e 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2879,7 +2879,7 @@ void FunctionValidator::visitStructSet(StructSet* curr) { return; } auto type = curr->ref->type.getHeapType(); - if (type == HeapType::none) { + if (type.isBasic() && type.getBasic(Unshared) == HeapType::none) { return; } if (!shouldBeTrue( diff --git a/test/spec/shared-struct.wast b/test/spec/shared-struct.wast index 28139bb2809..f321d880061 100644 --- a/test/spec/shared-struct.wast +++ b/test/spec/shared-struct.wast @@ -90,3 +90,11 @@ (func (param (ref null $i8)) (struct.set $i8 0 (local.get 0) (i32.const 0))) ) + +;; Bottom types +(module + (type $i8 (shared (struct (mut i8)))) + (func (drop (struct.get_s $i8 0 (ref.null (shared none))))) + (func (drop (struct.get_u $i8 0 (ref.null (shared none))))) + (func (struct.set $i8 0 (ref.null (shared none)) (i32.const 0))) +)