From 9d20a4e129dc6666f873d84566ea504dfc46ccdc Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:11:29 -0700 Subject: Make `i31ref` and `dataref` nullable (#4843) Match the latest version of the GC spec. This change does not depend on V8 changing its interpretation of the shorthands because we are still temporarily not emitting the binary shorthands, but all Binaryen users will have to update their interpretations along with this change if they use the text or binary shorthands. --- src/wasm/wasm-s-parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 362ba25f9..a7d63a7c6 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1179,10 +1179,10 @@ Type SExpressionWasmBuilder::stringToType(const char* str, return Type(HeapType::eq, Nullable); } if (strncmp(str, "i31ref", 6) == 0 && (prefix || str[6] == 0)) { - return Type(HeapType::i31, NonNullable); + return Type(HeapType::i31, Nullable); } if (strncmp(str, "dataref", 7) == 0 && (prefix || str[7] == 0)) { - return Type(HeapType::data, NonNullable); + return Type(HeapType::data, Nullable); } if (strncmp(str, "stringref", 9) == 0 && (prefix || str[9] == 0)) { return Type(HeapType::string, Nullable); -- cgit v1.2.3