summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r--src/wasm/wasm-s-parser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index c7cedfdbd..5ac36fda7 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -1257,6 +1257,9 @@ Type SExpressionWasmBuilder::stringToType(std::string_view str,
if (str.substr(0, 7) == "funcref" && (prefix || str.size() == 7)) {
return Type(HeapType::func, Nullable);
}
+ if (str.substr(0, 7) == "contref" && (prefix || str.size() == 7)) {
+ return Type(HeapType::cont, Nullable);
+ }
if (str.substr(0, 9) == "externref" && (prefix || str.size() == 9)) {
return Type(HeapType::ext, Nullable);
}
@@ -1302,6 +1305,9 @@ Type SExpressionWasmBuilder::stringToType(std::string_view str,
if (str.substr(0, 10) == "nullexnref" && (prefix || str.size() == 10)) {
return Type(HeapType::noexn, Nullable);
}
+ if (str.substr(0, 11) == "nullcontref" && (prefix || str.size() == 11)) {
+ return Type(HeapType::nocont, Nullable);
+ }
if (allowError) {
return Type::none;
}
@@ -1314,6 +1320,9 @@ HeapType SExpressionWasmBuilder::stringToHeapType(std::string_view str,
if (str.substr(0, 4) == "func" && (prefix || str.size() == 4)) {
return HeapType::func;
}
+ if (str.substr(0, 4) == "cont" && (prefix || str.size() == 4)) {
+ return HeapType::cont;
+ }
if (str.substr(0, 2) == "eq" && (prefix || str.size() == 2)) {
return HeapType::eq;
}
@@ -1362,6 +1371,9 @@ HeapType SExpressionWasmBuilder::stringToHeapType(std::string_view str,
if (str.substr(0, 5) == "noexn" && (prefix || str.size() == 5)) {
return HeapType::noexn;
}
+ if (str.substr(0, 6) == "nocont" && (prefix || str.size() == 6)) {
+ return HeapType::nocont;
+ }
throw ParseException(std::string("invalid wasm heap type: ") +
std::string(str.data(), str.size()));
}