diff options
author | Ben Smith <binji@chromium.org> | 2020-01-16 10:13:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 10:13:51 -0800 |
commit | d663c80dcb627fed3e21cfa2b47465452a83a894 (patch) | |
tree | 4053a21d1ee26e6d452cbe62454976bd6a76ceb0 /src/wast-parser.cc | |
parent | 0fdf72711e23116750f1aff34cae57f0d5c55125 (diff) | |
download | wabt-d663c80dcb627fed3e21cfa2b47465452a83a894.tar.gz wabt-d663c80dcb627fed3e21cfa2b47465452a83a894.tar.bz2 wabt-d663c80dcb627fed3e21cfa2b47465452a83a894.zip |
Update testsuite (#1308)
* Remove `assert_return_func`. This is now handled by using
`assert_return` with `(ref.func)`.
* The reference types proposal depends on the bulk memory proposal, so
using `--enable-reference-types` automatically includes
`--enable-bulk-memory`.
* `table.fill` no longer clamps to the valid range, and instead checks
before writing anything. This matches the other bulk instructions.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r-- | src/wast-parser.cc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index a3d2df53..a5edc6e3 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -222,7 +222,6 @@ bool IsCommand(TokenTypePair pair) { case TokenType::AssertInvalid: case TokenType::AssertMalformed: case TokenType::AssertReturn: - case TokenType::AssertReturnFunc: case TokenType::AssertTrap: case TokenType::AssertUnlinkable: case TokenType::Get: @@ -1733,8 +1732,11 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) { Var dst(0); Var src(0); if (options_->features.reference_types_enabled()) { + // TODO: disabled for now, since the spec tests don't currently use. +#if 0 CHECK_RESULT(ParseVar(&dst)); CHECK_RESULT(ParseVar(&src)); +#endif } out_expr->reset(new TableCopyExpr(dst, src, loc)); break; @@ -2174,7 +2176,8 @@ Result WastParser::ParseHostRef(Const* const_) { Result WastParser::ParseConstList(ConstVector* consts, ConstType type) { WABT_TRACE(ParseConstList); while (PeekMatchLpar(TokenType::Const) || PeekMatchLpar(TokenType::RefNull) || - PeekMatchLpar(TokenType::RefHost)) { + PeekMatchLpar(TokenType::RefHost) || + PeekMatchLpar(TokenType::RefFunc)) { Consume(); Const const_; switch (Peek()) { @@ -2189,6 +2192,14 @@ Result WastParser::ParseConstList(ConstVector* consts, ConstType type) { const_.ref_bits = 0; break; } + case TokenType::RefFunc: { + auto token = Consume(); + ErrorUnlessOpcodeEnabled(token); + const_.loc = GetLocation(); + const_.type = Type::Funcref; + const_.ref_bits = 0; + break; + } case TokenType::RefHost: CHECK_RESULT(ParseHostRef(&const_)); break; @@ -2476,9 +2487,6 @@ Result WastParser::ParseCommand(Script* script, CommandPtr* out_command) { case TokenType::AssertReturn: return ParseAssertReturnCommand(out_command); - case TokenType::AssertReturnFunc: - return ParseAssertReturnFuncCommand(out_command); - case TokenType::AssertTrap: return ParseAssertTrapCommand(out_command); @@ -2531,17 +2539,6 @@ Result WastParser::ParseAssertReturnCommand(CommandPtr* out_command) { return Result::Ok; } -Result WastParser::ParseAssertReturnFuncCommand(CommandPtr* out_command) { - WABT_TRACE(ParseAssertReturnFuncCommand); - EXPECT(Lpar); - EXPECT(AssertReturnFunc); - auto command = MakeUnique<AssertReturnFuncCommand>(); - CHECK_RESULT(ParseAction(&command->action)); - EXPECT(Rpar); - *out_command = std::move(command); - return Result::Ok; -} - Result WastParser::ParseAssertTrapCommand(CommandPtr* out_command) { WABT_TRACE(ParseAssertTrapCommand); EXPECT(Lpar); |