diff options
author | Sam Clegg <sbc@chromium.org> | 2019-11-07 18:42:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 18:42:51 -0800 |
commit | 2e2991e5a0e6a75d57c9ed6ff7ee0ae88adf253f (patch) | |
tree | 724bddd7110147c66163e6f230d4456e1e1e870f /src/wast-parser.cc | |
parent | 2561eaca9cdba262eaa1e74ce877ffc7be543323 (diff) | |
download | wabt-2e2991e5a0e6a75d57c9ed6ff7ee0ae88adf253f.tar.gz wabt-2e2991e5a0e6a75d57c9ed6ff7ee0ae88adf253f.tar.bz2 wabt-2e2991e5a0e6a75d57c9ed6ff7ee0ae88adf253f.zip |
Initial implementation of reftype proposal in the interpreter. (#1206)
- Implement ref.func everywhere.
- Implement table.get and table.set in the interpreter.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r-- | src/wast-parser.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc index ca21584f..8e85d830 100644 --- a/src/wast-parser.cc +++ b/src/wast-parser.cc @@ -145,6 +145,7 @@ bool IsPlainInstr(TokenType token_type) { case TokenType::TableSize: case TokenType::Throw: case TokenType::Rethrow: + case TokenType::RefFunc: case TokenType::RefNull: case TokenType::RefIsNull: case TokenType::AtomicLoad: @@ -1689,6 +1690,11 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) { CHECK_RESULT(ParsePlainInstrVar<TableSizeExpr>(loc, out_expr)); break; + case TokenType::RefFunc: + ErrorUnlessOpcodeEnabled(Consume()); + CHECK_RESULT(ParsePlainInstrVar<RefFuncExpr>(loc, out_expr)); + break; + case TokenType::RefNull: ErrorUnlessOpcodeEnabled(Consume()); out_expr->reset(new RefNullExpr(loc)); |