From 192757772adce7568fc1f3f3e733a4263b6392c6 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Fri, 11 Sep 2020 03:04:17 +0200 Subject: Add anyref feature and type (#3109) Adds `anyref` type, which is enabled by a new feature `--enable-anyref`. This type is primarily used for testing that passes correctly handle subtype relationships so that the codebase will continue to be prepared for future subtyping. Since `--enable-anyref` is meaningless without also using `--enable-reference-types`, this PR also makes it a validation error to pass only the former (and similarly makes it a validation error to enable exception handling without enabling reference types). --- src/wasm/wasm-s-parser.cpp | 3 +++ 1 file changed, 3 insertions(+) (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 bac5f958c..e4a33c034 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -874,6 +874,9 @@ Type SExpressionWasmBuilder::stringToType(const char* str, if (strncmp(str, "exnref", 6) == 0 && (prefix || str[6] == 0)) { return Type::exnref; } + if (strncmp(str, "anyref", 6) == 0 && (prefix || str[6] == 0)) { + return Type::anyref; + } if (allowError) { return Type::none; } -- cgit v1.2.3