summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index b3128025e..afbee4435 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -2700,11 +2700,12 @@ Literal Literal::externalize() const {
}
Literal Literal::internalize() const {
- auto extType = HeapTypes::ext.getBasic(type.getHeapType().getShared());
+ auto share = type.getHeapType().getShared();
+ auto extType = HeapTypes::ext.getBasic(share);
assert(Type::isSubType(type, Type(extType, Nullable)) &&
"can only internalize external references");
if (isNull()) {
- return Literal(std::shared_ptr<GCData>{}, HeapType::none);
+ return Literal(std::shared_ptr<GCData>{}, HeapTypes::none.getBasic(share));
}
if (gcData->type.isMaybeShared(HeapType::i31)) {
assert(gcData->values[0].type.getHeapType().isMaybeShared(HeapType::i31));