From 13725e54f845ec84947130aaa888b4c11e53f9af Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 9 Oct 2019 13:40:06 -0700 Subject: Make try body with multiple instructions roundtrip (#2374) Previously we didn't print an additional block when there are multiple instructions within a `try` body, so those wast files cannot be parsed correctly, because the wast parser assumes there are two bodies within a `try` scope: a try body and a catch body. We don't need to print an additional block for a `catch` body because `(catch ...)` itself serves as a scope. --- src/wasm/wasm-s-parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 72d262e63..f666abc25 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1792,7 +1792,7 @@ Expression* SExpressionWasmBuilder::makeTry(Element& s) { ret->body = parseExpression(*s[i++]); } if (!elementStartsWith(*s[i], "catch")) { - throw ParseException("catch clause does not exist"); + throw ParseException("catch clause does not exist", s[i]->line, s[i]->col); } ret->catchBody = makeCatch(*s[i++]); ret->finalize(type); -- cgit v1.2.3