summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 58699ad8b..8a2b4755c 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1227,15 +1227,18 @@ void RefAs::finalize() {
type = Type::unreachable;
return;
}
+ auto valHeapType = value->type.getHeapType();
switch (op) {
case RefAsNonNull:
- type = Type(value->type.getHeapType(), NonNullable);
+ type = Type(valHeapType, NonNullable);
break;
case AnyConvertExtern:
- type = Type(HeapType::any, value->type.getNullability());
+ type = Type(HeapTypes::any.getBasic(valHeapType.getShared()),
+ value->type.getNullability());
break;
case ExternConvertAny:
- type = Type(HeapType::ext, value->type.getNullability());
+ type = Type(HeapTypes::ext.getBasic(valHeapType.getShared()),
+ value->type.getNullability());
break;
default:
WASM_UNREACHABLE("invalid ref.as_*");