From ff28aab1919ef2f7ddd209f06357d8cb716d278c Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 29 Jun 2021 09:53:16 -0700 Subject: [PATCH] Address feedback --- src/wast-parser.cc | 1 + test/parse/expr/bad-try-clause.txt | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/parse/expr/bad-try-clause.txt diff --git a/src/wast-parser.cc b/src/wast-parser.cc index 23595d9b31..e5a6f6dffc 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -2794,6 +2794,7 @@ Result WastParser::ParseExpr(ExprList* exprs) { break; } default: + ErrorExpected({"catch", "catch_all", "unwind", "delegate"}); break; } } diff --git a/test/parse/expr/bad-try-clause.txt b/test/parse/expr/bad-try-clause.txt new file mode 100644 index 0000000000..d5f3eb7c6c --- /dev/null +++ b/test/parse/expr/bad-try-clause.txt @@ -0,0 +1,10 @@ +;;; TOOL: wat2wasm +;;; ARGS: --enable-exceptions +;;; ERROR: 1 +(module + (func (try (do) (foo))) +(;; STDERR ;;; +out/test/parse/expr/bad-try-clause.txt:5:20: error: unexpected token "foo", expected catch, catch_all, unwind or delegate. + (func (try (do) (foo))) + ^^^ +;;; STDERR ;;)