@@ -1500,6 +1500,9 @@ void WasmBinaryWriter::writeType(Type type) {
15001500 case HeapType::func:
15011501 o << S32LEB (BinaryConsts::EncodedType::funcref);
15021502 return ;
1503+ case HeapType::cont:
1504+ o << S32LEB (BinaryConsts::EncodedType::contref);
1505+ return ;
15031506 case HeapType::eq:
15041507 o << S32LEB (BinaryConsts::EncodedType::eqref);
15051508 return ;
@@ -1539,6 +1542,9 @@ void WasmBinaryWriter::writeType(Type type) {
15391542 case HeapType::noexn:
15401543 o << S32LEB (BinaryConsts::EncodedType::nullexnref);
15411544 return ;
1545+ case HeapType::nocont:
1546+ o << S32LEB (BinaryConsts::EncodedType::nullcontref);
1547+ return ;
15421548 }
15431549 }
15441550 if (type.isNullable ()) {
@@ -1612,6 +1618,9 @@ void WasmBinaryWriter::writeHeapType(HeapType type) {
16121618 case HeapType::func:
16131619 ret = BinaryConsts::EncodedHeapType::func;
16141620 break ;
1621+ case HeapType::cont:
1622+ ret = BinaryConsts::EncodedHeapType::cont;
1623+ break ;
16151624 case HeapType::any:
16161625 ret = BinaryConsts::EncodedHeapType::any;
16171626 break ;
@@ -1654,6 +1663,9 @@ void WasmBinaryWriter::writeHeapType(HeapType type) {
16541663 case HeapType::noexn:
16551664 ret = BinaryConsts::EncodedHeapType::noexn;
16561665 break ;
1666+ case HeapType::nocont:
1667+ ret = BinaryConsts::EncodedHeapType::nocont;
1668+ break ;
16571669 }
16581670 o << S64LEB (ret); // TODO: Actually s33
16591671}
@@ -1986,6 +1998,9 @@ bool WasmBinaryReader::getBasicType(int32_t code, Type& out) {
19861998 case BinaryConsts::EncodedType::funcref:
19871999 out = Type (HeapType::func, Nullable);
19882000 return true ;
2001+ case BinaryConsts::EncodedType::contref:
2002+ out = Type (HeapType::cont, Nullable);
2003+ return true ;
19892004 case BinaryConsts::EncodedType::externref:
19902005 out = Type (HeapType::ext, Nullable);
19912006 return true ;
@@ -2031,6 +2046,9 @@ bool WasmBinaryReader::getBasicType(int32_t code, Type& out) {
20312046 case BinaryConsts::EncodedType::nullexnref:
20322047 out = Type (HeapType::noexn, Nullable);
20332048 return true ;
2049+ case BinaryConsts::EncodedType::nullcontref:
2050+ out = Type (HeapType::nocont, Nullable);
2051+ return true ;
20342052 default :
20352053 return false ;
20362054 }
@@ -2041,6 +2059,9 @@ bool WasmBinaryReader::getBasicHeapType(int64_t code, HeapType& out) {
20412059 case BinaryConsts::EncodedHeapType::func:
20422060 out = HeapType::func;
20432061 return true ;
2062+ case BinaryConsts::EncodedHeapType::cont:
2063+ out = HeapType::func;
2064+ return true ;
20442065 case BinaryConsts::EncodedHeapType::ext:
20452066 out = HeapType::ext;
20462067 return true ;
@@ -2086,6 +2107,9 @@ bool WasmBinaryReader::getBasicHeapType(int64_t code, HeapType& out) {
20862107 case BinaryConsts::EncodedHeapType::noexn:
20872108 out = HeapType::noexn;
20882109 return true ;
2110+ case BinaryConsts::EncodedHeapType::nocont:
2111+ out = HeapType::nocont;
2112+ return true ;
20892113 default :
20902114 return false ;
20912115 }
0 commit comments