diff options
author | Ben Smith <binji@chromium.org> | 2020-05-14 17:58:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 17:58:29 -0700 |
commit | ebbf625e15b844d43feb24134b9a9cd3ea91daca (patch) | |
tree | 0d516ecbb2589b1c5e8ae7685bcdb956f523161a /src/wast-parser.cc | |
parent | d087e702d520207871ae82c58461fb08d58af187 (diff) | |
download | wabt-ebbf625e15b844d43feb24134b9a9cd3ea91daca.tar.gz wabt-ebbf625e15b844d43feb24134b9a9cd3ea91daca.tar.bz2 wabt-ebbf625e15b844d43feb24134b9a9cd3ea91daca.zip |
Require `do` in folded `try` statement (#1425)
For example:
```
(try $label (param ...) (result ...)
(do ...)
(catch ...)
)
```
See comment here:
https://github.com/WebAssembly/exception-handling/issues/52#issuecomment-626696720
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r-- | src/wast-parser.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index 4a7ad526..2824a382 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2652,8 +2652,11 @@ Result WastParser::ParseExpr(ExprList* exprs) { auto expr = MakeUnique<TryExpr>(loc); CHECK_RESULT(ParseLabelOpt(&expr->block.label)); CHECK_RESULT(ParseBlockDeclaration(&expr->block.decl)); + EXPECT(Lpar); + EXPECT(Do); CHECK_RESULT(ParseInstrList(&expr->block.exprs)); expr->block.end_loc = GetLocation(); + EXPECT(Rpar); EXPECT(Lpar); EXPECT(Catch); CHECK_RESULT(ParseTerminatingInstrList(&expr->catch_)); |