diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 2 | ||||
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index ed868deb6..2f7588b37 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -264,7 +264,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> { printCallBody(curr); } void visitCallIndirect(CallIndirect *curr) { - printOpening(o, "call_indirect ") << curr->fullType; + printOpening(o, "call_indirect (type ") << curr->fullType << ')'; incIndent(); for (auto operand : curr->operands) { printFullLine(operand); 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; |