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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 84576fde7..0356db235 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -867,6 +867,10 @@ Type SExpressionWasmBuilder::stringToType(const char* str,
if (strncmp(str, "eqref", 5) == 0 && (prefix || str[5] == 0)) {
return Type::eqref;
}
+ if (strncmp(str, "dataref", 7) == 0 && (prefix || str[7] == 0)) {
+ // FIXME: for now, force all inputs to be nullable
+ return Type(HeapType::BasicHeapType::data, Nullable);
+ }
if (strncmp(str, "i31ref", 6) == 0 && (prefix || str[6] == 0)) {
// FIXME: for now, force all inputs to be nullable
return Type(HeapType::BasicHeapType::i31, Nullable);
@@ -909,6 +913,12 @@ HeapType SExpressionWasmBuilder::stringToHeapType(const char* str,
return HeapType::func;
}
}
+ if (str[0] == 'd') {
+ if (str[1] == 'a' && str[2] == 't' && str[3] == 'a' &&
+ (prefix || str[4] == 0)) {
+ return HeapType::data;
+ }
+ }
throw ParseException(std::string("invalid wasm heap type: ") + str);
}