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.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index af77d75b6..b2ee2a2f4 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -955,6 +955,15 @@ Expression* SExpressionWasmBuilder::makeHost(Element& s, HostOp op) {
} else {
parseCallOperands(s, 1, s.size(), ret);
}
+ if (ret->op == HostOp::GrowMemory) {
+ if (ret->operands.size() != 1) {
+ throw ParseException("grow_memory needs one operand");
+ }
+ } else {
+ if (ret->operands.size() != 0) {
+ throw ParseException("host needs zero operands");
+ }
+ }
ret->finalize();
return ret;
}