From 7438fbd5cb4d882584f405ae37e726fd14928f4d Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Mon, 29 May 2017 13:52:42 -0700 Subject: handle a parse error of a function declaration with mixed import inside --- src/wasm/wasm-s-parser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 77ca8910d..614b30bdd 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -577,6 +577,7 @@ void SExpressionWasmBuilder::parseFunction(Element& s, bool preParseImport) { im->kind = ExternalKind::Function; im->functionType = wasm.getFunctionType(type)->name; wasm.addImport(im.release()); + if (currFunction) throw ParseException("import module inside function dec"); assert(!currFunction); currLocalTypes.clear(); nameMapper.clear(); -- cgit v1.2.3