From 74bc353d4fedd9fff308aecfae183b6b7525c7d3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 3 Jun 2016 13:52:38 -0700 Subject: check function types in s-parsing --- src/wasm-s-parser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 9d33504ac..2f1a1bc1b 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1094,7 +1094,8 @@ private: Expression* makeCallIndirect(Element& s) { auto ret = allocator.alloc(); IString type = s[1]->str(); - ret->fullType = wasm.getFunctionType(type); + ret->fullType = wasm.checkFunctionType(type); + if (!ret->fullType) throw ParseException("invalid call_indirect type", s.line, s.col); assert(ret->fullType); ret->type = ret->fullType->result; ret->target = parseExpression(s[2]); -- cgit v1.2.3