diff --git a/src/module/imports.rs b/src/module/imports.rs index 868bd5d5..bc5e0909 100644 --- a/src/module/imports.rs +++ b/src/module/imports.rs @@ -172,6 +172,7 @@ impl Module { t.maximum, ty, ); + ids.num_table_imports += 1; ids.push_table(id.0); } wasmparser::ImportSectionEntryType::Memory(m) => { @@ -185,6 +186,7 @@ impl Module { m.initial as u32, m.maximum.map(|m| m as u32), ); + ids.num_mem_imports += 1; ids.push_memory(id.0); } wasmparser::ImportSectionEntryType::Global(g) => { @@ -194,6 +196,7 @@ impl Module { ValType::parse(&g.content_type)?, g.mutable, ); + ids.num_global_imports += 1; ids.push_global(id.0); } wasmparser::ImportSectionEntryType::Module(_) diff --git a/src/parse.rs b/src/parse.rs index 7d5eb92d..6f224db2 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -27,6 +27,9 @@ pub struct IndicesToIds { data: Vec, locals: IdHashMap>, pub(crate) num_fun_imports: usize, + pub(crate) num_mem_imports: usize, + pub(crate) num_global_imports: usize, + pub(crate) num_table_imports: usize, } macro_rules! define_push_get {