summaryrefslogtreecommitdiff
path: root/crates/parser/src
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-29 17:31:01 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-29 17:31:01 +0100
commitb0b4eba3b7ff5bfbcb8835c473ac3945c5160332 (patch)
tree7c62cda50a88f6928eb2ef01eb6825d874595f5a /crates/parser/src
parentfd91a1c273b7595f74e4eebac9497b10e0a75e9f (diff)
feat: Bulk Memory Operations Proposal
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src')
-rw-r--r--crates/parser/src/conversion.rs1
-rw-r--r--crates/parser/src/module.rs8
2 files changed, 7 insertions, 2 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs
index 79069e1..7c10d62 100644
--- a/crates/parser/src/conversion.rs
+++ b/crates/parser/src/conversion.rs
@@ -107,7 +107,6 @@ pub(crate) fn convert_module_tables<T: IntoIterator<Item = wasmparser::Result<wa
table_types: T,
) -> Result<Vec<TableType>> {
let table_type = table_types.into_iter().map(|table| convert_module_table(table?)).collect::<Result<Vec<_>>>()?;
-
Ok(table_type)
}
diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs
index 5bc6a7e..f5c01ac 100644
--- a/crates/parser/src/module.rs
+++ b/crates/parser/src/module.rs
@@ -112,7 +112,6 @@ impl ModuleReader {
if !self.table_types.is_empty() {
return Err(ParseError::DuplicateSection("Table section".into()));
}
-
debug!("Found table section");
validator.table_section(&reader)?;
self.table_types = conversion::convert_module_tables(reader)?;
@@ -140,6 +139,13 @@ impl ModuleReader {
validator.data_section(&reader)?;
self.data = conversion::convert_module_data_sections(reader)?;
}
+ DataCountSection { count, range } => {
+ debug!("Found data count section");
+ if !self.data.is_empty() {
+ return Err(ParseError::DuplicateSection("Data count section".into()));
+ }
+ validator.data_count_section(count, &range)?;
+ }
CodeSectionStart { count, range, .. } => {
debug!("Found code section ({} functions)", count);
if !self.code.is_empty() {