diff options
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/literal.cpp | 3 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 2 | ||||
-rw-r--r-- | src/wasm/wasm-validator.cpp | 2 | ||||
-rw-r--r-- | src/wasm/wasm.cpp | 3 |
4 files changed, 4 insertions, 6 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index a49fa1b62..6e9c3eaf4 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -57,8 +57,7 @@ Literal::Literal(Type type) : type(type) { return; } - if (type.isRef() && type.getHeapType().isBasic() && - type.getHeapType().getBasic(Unshared) == HeapType::i31) { + if (type.isRef() && type.getHeapType().isMaybeShared(HeapType::i31)) { assert(type.isNonNullable()); i32 = 0; return; diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 20815b701..0a65fbadb 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1521,7 +1521,7 @@ void WasmBinaryWriter::writeType(Type type) { // those more refined types. if (!wasm->features.hasGC()) { auto ht = type.getHeapType(); - if (ht.isBasic() && ht.getBasic(Unshared) == HeapType::string) { + if (ht.isMaybeShared(HeapType::string)) { // Do not overgeneralize stringref to anyref. We have tests that when a // stringref is expected, we actually get a stringref. If we see a // string, the stringref feature must be enabled. diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 9994adf1e..287ab2e8f 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -2910,7 +2910,7 @@ void FunctionValidator::visitStructSet(StructSet* curr) { return; } auto type = curr->ref->type.getHeapType(); - if (type.isBasic() && type.getBasic(Unshared) == HeapType::none) { + if (type.isMaybeShared(HeapType::none)) { return; } if (!shouldBeTrue( diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index c4f02128e..4c30a4e32 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -964,8 +964,7 @@ void RefI31::finalize() { if (value->type == Type::unreachable) { type = Type::unreachable; } else { - assert(type.isRef() && type.getHeapType().isBasic() && - type.getHeapType().getBasic(Unshared) == HeapType::i31); + assert(type.isRef() && type.getHeapType().isMaybeShared(HeapType::i31)); } } |