Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation rules for memory.copy/fill/init #56

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,17 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : op_type
[value_type_of_index_type it] --> [value_type_of_index_type it]

| MemoryFill ->
ignore (memory c (0l @@ e.at));
[NumType I32Type; NumType I32Type; NumType I32Type] --> []
let MemoryType (_, it) = memory c (0l @@ e.at) in
[value_type_of_index_type it; NumType I32Type; value_type_of_index_type it] --> []

| MemoryCopy ->
ignore (memory c (0l @@ e.at));
[NumType I32Type; NumType I32Type; NumType I32Type] --> []
let MemoryType (_, it) = memory c (0l @@ e.at) in
[value_type_of_index_type it; value_type_of_index_type it; value_type_of_index_type it] --> []

| MemoryInit x ->
ignore (memory c (0l @@ e.at));
let MemoryType (_, it) = memory c (0l @@ e.at) in
ignore (data c x);
[NumType I32Type; NumType I32Type; NumType I32Type] --> []
[value_type_of_index_type it; value_type_of_index_type it; value_type_of_index_type it] --> []

| DataDrop x ->
ignore (data c x);
Expand Down
5,574 changes: 5,574 additions & 0 deletions test/core/memory_copy.wast

Large diffs are not rendered by default.

Loading
Loading