Skip to content

Commit 78e8a97

Browse files
committed
Prepare for GC a little by generalizing heap type writing code
1 parent 423ed28 commit 78e8a97

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -955,15 +955,13 @@ void WasmBinaryWriter::finishUp() {
955955
void WasmBinaryWriter::writeType(Type type) {
956956
if (type.isRef()) {
957957
auto heapType = type.getHeapType();
958-
if (heapType.isSignature()) {
959-
if (type.isNullable()) {
960-
o << S32LEB(BinaryConsts::EncodedType::nullable);
961-
} else {
962-
o << S32LEB(BinaryConsts::EncodedType::nonnullable);
963-
}
964-
writeHeapType(heapType);
965-
return;
958+
if (type.isNullable()) {
959+
o << S32LEB(BinaryConsts::EncodedType::nullable);
960+
} else {
961+
o << S32LEB(BinaryConsts::EncodedType::nonnullable);
966962
}
963+
writeHeapType(heapType);
964+
return;
967965
}
968966
int ret = 0;
969967
TODO_SINGLE_COMPOUND(type);

0 commit comments

Comments
 (0)