summaryrefslogtreecommitdiff
path: root/src/validator.cc
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-11-25 21:41:13 -0600
committerGitHub <noreply@github.com>2019-11-25 21:41:13 -0600
commit4386b19e2854e8d5f303bd7236a20092ff77cb9a (patch)
tree456c3dc52d40d05910c422c1072c0320cce88909 /src/validator.cc
parent3130ab89d7864ae9105ccca5c241024f9536ab69 (diff)
downloadwabt-4386b19e2854e8d5f303bd7236a20092ff77cb9a.tar.gz
wabt-4386b19e2854e8d5f303bd7236a20092ff77cb9a.tar.bz2
wabt-4386b19e2854e8d5f303bd7236a20092ff77cb9a.zip
reference-types: add table.fill instruction (#1252)
Diffstat (limited to 'src/validator.cc')
-rw-r--r--src/validator.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/validator.cc b/src/validator.cc
index 78293ded..388863cd 100644
--- a/src/validator.cc
+++ b/src/validator.cc
@@ -80,6 +80,7 @@ class Validator : public ExprVisitor::Delegate {
Result OnTableSetExpr(TableSetExpr*) override;
Result OnTableGrowExpr(TableGrowExpr*) override;
Result OnTableSizeExpr(TableSizeExpr*) override;
+ Result OnTableFillExpr(TableFillExpr*) override;
Result OnRefFuncExpr(RefFuncExpr*) override;
Result OnRefNullExpr(RefNullExpr*) override;
Result OnRefIsNullExpr(RefIsNullExpr*) override;
@@ -822,6 +823,15 @@ Result Validator::OnTableSizeExpr(TableSizeExpr* expr) {
return Result::Ok;
}
+Result Validator::OnTableFillExpr(TableFillExpr* expr) {
+ const Table* table;
+ CheckTableVar(&expr->var, &table);
+ expr_loc_ = &expr->loc;
+ CheckHasTable(&expr->loc, Opcode::TableFill, expr->var.index());
+ typechecker_.OnTableFill(table->elem_type);
+ return Result::Ok;
+}
+
Result Validator::OnRefFuncExpr(RefFuncExpr* expr) {
expr_loc_ = &expr->loc;
const Func* callee;