From c8804f12e3d37030e1b2f158d5932e0626933c89 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 16 Nov 2015 18:22:21 -0800 Subject: handle imports with a return type --- src/wasm-s-parser.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/wasm-s-parser.h') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 4b05bb91d..2e01bfc5f 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1095,7 +1095,11 @@ private: } else { onError(); } - assert(s.size() == 5); + if (s.size() > 5) { + Element& result = *s[5]; + assert(result[0]->str() == RESULT); + im->type.result = stringToWasmType(result[1]->str()); + } wasm.addImport(im); } -- cgit v1.2.3