Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
[interpreter/test] Fix validation for elem.drop (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen authored Feb 6, 2020
1 parent 11388e7 commit 404b7e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
[I32Type; I32Type; I32Type] --> []

| ElemDrop x ->
ignore (table c (0l @@ e.at));
ignore (elem c x);
[] --> []

Expand Down Expand Up @@ -295,7 +294,6 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
[I32Type; I32Type; I32Type] --> []

| DataDrop x ->
ignore (memory c (0l @@ e.at));
ignore (data c x);
[] --> []

Expand Down
2 changes: 1 addition & 1 deletion test/core/memory_init.wast
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
(module
(func (export "test")
(data.drop 0)))
"unknown memory 0")
"unknown data segment")

(assert_invalid
(module
Expand Down
4 changes: 2 additions & 2 deletions test/core/table_init.wast
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
(module
(func (export "test")
(elem.drop 0)))
"unknown table 0")
"unknown elem segment 0")

(assert_invalid
(module
Expand All @@ -207,7 +207,7 @@
(func (result i32) (i32.const 0))
(func (export "test")
(elem.drop 4)))
"unknown table 0")
"unknown elem segment 4")

(assert_invalid
(module
Expand Down

0 comments on commit 404b7e7

Please sign in to comment.