diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parser/contexts.h | 3 | ||||
-rw-r--r-- | src/wasm-binary.h | 1 | ||||
-rw-r--r-- | src/wasm/wasm-binary.cpp | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/parser/contexts.h b/src/parser/contexts.h index 351f6a208..4acfc981a 100644 --- a/src/parser/contexts.h +++ b/src/parser/contexts.h @@ -1118,7 +1118,8 @@ struct ParseImplicitTypeDefsCtx : TypeParserCtx<ParseImplicitTypeDefsCtx> { : TypeParserCtx<ParseImplicitTypeDefsCtx>(typeIndices), in(in), types(types), implicitTypes(implicitTypes) { for (auto type : types) { - if (type.isSignature() && type.getRecGroup().size() == 1) { + if (type.isSignature() && type.getRecGroup().size() == 1 && + !type.isShared()) { sigTypes.insert({type.getSignature(), type}); } } diff --git a/src/wasm-binary.h b/src/wasm-binary.h index ebfc27b1f..9a79a4c8b 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -377,6 +377,7 @@ enum EncodedType { Array = -0x22, // 0x5e Sub = -0x30, // 0x50 SubFinal = -0x31, // 0x4f + Shared = -0x24, // 0x65 // isorecursive recursion groups Rec = -0x32, // 0x4e // block_type diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 7b88bdd76..924bf1601 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -285,6 +285,9 @@ void WasmBinaryWriter::writeTypes() { o << U32LEB(0); } } + if (type.isShared()) { + o << S32LEB(BinaryConsts::EncodedType::Shared); + } if (type.isSignature()) { o << S32LEB(BinaryConsts::EncodedType::Func); auto sig = type.getSignature(); @@ -2391,6 +2394,10 @@ void WasmBinaryReader::readTypes() { } form = getS32LEB(); } + if (form == BinaryConsts::Shared) { + builder[i].setShared(); + form = getS32LEB(); + } if (form == BinaryConsts::EncodedType::Func) { builder[i] = readSignatureDef(); } else if (form == BinaryConsts::EncodedType::Cont) { |