summaryrefslogtreecommitdiff
path: root/src/wasm-builder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r--src/wasm-builder.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h
index 1e768b11c..6663417f8 100644
--- a/src/wasm-builder.h
+++ b/src/wasm-builder.h
@@ -1217,8 +1217,10 @@ public:
if (type.isFunction()) {
return makeRefFunc(value.getFunc(), type.getHeapType());
}
- if (type.isRef() && type.getHeapType() == HeapType::i31) {
- return makeRefI31(makeConst(value.geti31()));
+ if (type.isRef() && type.getHeapType().isBasic() &&
+ type.getHeapType().getBasic(Unshared) == HeapType::i31) {
+ return makeRefI31(makeConst(value.geti31()),
+ type.getHeapType().getShared());
}
if (type.isString()) {
// The string is already WTF-16, but we need to convert from `Literals` to