diff options
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r-- | src/wasm/wasm-binary.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index ee8afeb93..d35edadc8 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -1629,20 +1629,7 @@ void WasmBinaryWriter::writeHeapType(HeapType type) { // only actually valid with GC. Otherwise, emit the corresponding valid top // types instead. if (!wasm->features.hasGC()) { - if (HeapType::isSubType(type, HeapType::func)) { - type = HeapType::func; - } else if (HeapType::isSubType(type, HeapType::ext)) { - type = HeapType::ext; - } else if (HeapType::isSubType(type, HeapType::exn)) { - type = HeapType::exn; - } else if (wasm->features.hasStrings()) { - // Strings are enabled, and this isn't a func or an ext, so it must be a - // string type (string or stringview), which we'll emit below, or a bottom - // type (which we must allow, because we wouldn't know whether to emit a - // string or stringview for it). - } else { - WASM_UNREACHABLE("invalid type without GC"); - } + type = type.getTop(); } if (!type.isBasic()) { |