summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/literal.cpp2
-rw-r--r--src/wasm/wasm-type.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 3dcf9e350..f2100ea71 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -439,7 +439,7 @@ bool Literal::operator==(const Literal& other) const {
assert(func.is() && other.func.is());
return func == other.func;
}
- if (type.getHeapType().isMaybeShared(HeapType::string)) {
+ if (type.isString()) {
return gcData->values == other.gcData->values;
}
if (type.isData()) {
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index aa3847a8b..173e4b8c3 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -814,6 +814,8 @@ bool Type::isStruct() const { return isRef() && getHeapType().isStruct(); }
bool Type::isArray() const { return isRef() && getHeapType().isArray(); }
+bool Type::isString() const { return isRef() && getHeapType().isString(); }
+
bool Type::isDefaultable() const {
// A variable can get a default value if its type is concrete (unreachable
// and none have no values, hence no default), and if it's a reference, it