summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 afbee4435..7e4aeb8c7 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -2687,11 +2687,12 @@ Literal Literal::relaxedFmsF64x2(const Literal& left,
Literal Literal::externalize() const {
assert(type.isRef() && type.getHeapType().getUnsharedTop() == HeapType::any &&
"can only externalize internal references");
+ auto share = type.getHeapType().getShared();
if (isNull()) {
- return Literal(std::shared_ptr<GCData>{}, HeapType::noext);
+ return Literal(std::shared_ptr<GCData>{}, HeapTypes::noext.getBasic(share));
}
auto heapType = type.getHeapType();
- auto extType = HeapTypes::ext.getBasic(heapType.getShared());
+ auto extType = HeapTypes::ext.getBasic(share);
if (heapType.isMaybeShared(HeapType::i31)) {
return Literal(std::make_shared<GCData>(heapType, Literals{*this}),
extType);