summaryrefslogtreecommitdiff
path: root/src/literal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/literal.h')
-rw-r--r--src/literal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/literal.h b/src/literal.h
index 317839b72..9d7ac2222 100644
--- a/src/literal.h
+++ b/src/literal.h
@@ -769,6 +769,14 @@ template<> struct hash<wasm::Literal> {
wasm::rehash(digest, a.geti31(true));
return digest;
}
+ if (a.type.isString()) {
+ auto& values = a.getGCData()->values;
+ wasm::rehash(digest, values.size());
+ for (auto c : values) {
+ wasm::rehash(digest, c.getInteger());
+ }
+ return digest;
+ }
// other non-null reference type literals cannot represent concrete
// values, i.e. there is no concrete anyref or eqref other than null.
WASM_UNREACHABLE("unexpected type");