summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 9c8b83325..6ce2c7979 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -251,12 +251,11 @@ void WasmBinaryWriter::writeTypes() {
WASM_UNREACHABLE("TODO GC type writing");
}
if (nominal) {
- HeapType super;
- bool hasSuper = type.getSuperType(super);
- if (!hasSuper) {
+ auto super = type.getSuperType();
+ if (!super) {
super = type.isFunction() ? HeapType::func : HeapType::data;
}
- writeHeapType(super);
+ writeHeapType(*super);
}
}
finishSection(start);