summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-11-13 15:18:30 -0800
committerGitHub <noreply@github.com>2017-11-13 15:18:30 -0800
commitca09203416a556f0a895f6cfa32426bdd46f9824 (patch)
tree263697a28594c67424472a7410d256994476f4de /src/wasm
parent20b8b02ff331f8b59d44e2a72ebd6f81e08f49ac (diff)
downloadbinaryen-ca09203416a556f0a895f6cfa32426bdd46f9824.tar.gz
binaryen-ca09203416a556f0a895f6cfa32426bdd46f9824.tar.bz2
binaryen-ca09203416a556f0a895f6cfa32426bdd46f9824.zip
Update call_indirect text syntax to match spec update (#1281)
Function type gets its own element rather than being a part of the call_indirect (see WebAssembly/spec#599)
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-s-parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 599eec5b8..0de3edf3f 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -1387,7 +1387,9 @@ Expression* SExpressionWasmBuilder::makeCallImport(Element& s) {
Expression* SExpressionWasmBuilder::makeCallIndirect(Element& s) {
if (!wasm.table.exists) throw ParseException("no table");
auto ret = allocator.alloc<CallIndirect>();
- IString type = s[1]->str();
+ Element& typeElement = *s[1];
+ if (typeElement[0]->str() != "type") throw ParseException("expected 'type' in call_indirect", s.line, s.col);
+ IString type = typeElement[1]->str();
auto* fullType = wasm.getFunctionTypeOrNull(type);
if (!fullType) throw ParseException("invalid call_indirect type", s.line, s.col);
ret->fullType = fullType->name;