Skip to content

Commit ee45028

Browse files
authored
Don't validate memories in data.drop instructions (bytecodealliance#209)
For `data.drop` nowadays we only need to validate that the data segment is a valid index, there's no need for the module to have a defined memory.
1 parent 29cc6a4 commit ee45028

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

src/operators_validator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,6 @@ impl OperatorValidator {
19691969
}
19701970
Operator::DataDrop { segment } => {
19711971
self.check_bulk_memory_enabled()?;
1972-
self.check_memory_index(0, resources)?;
19731972
if segment >= resources.data_count() {
19741973
return Err(OperatorValidatorError::new(
19751974
"unknown data segment: segment index out of bounds",

src/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ mod wast_tests {
558558
("ref_func.wast", _) => true,
559559
("table-sub.wast", _) => true,
560560
("table_grow.wast", _) => true,
561+
("memory_init.wast", _) => true,
561562
_ => false,
562563
},
563564
);

0 commit comments

Comments
 (0)