Skip to content

Commit

Permalink
counters
Browse files Browse the repository at this point in the history
  • Loading branch information
gkgoat1 committed Dec 30, 2023
1 parent 94ec3c5 commit 5276c4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/module/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ impl Module {
t.maximum,
ty,
);
ids.num_table_imports += 1;
ids.push_table(id.0);
}
wasmparser::ImportSectionEntryType::Memory(m) => {
Expand All @@ -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) => {
Expand All @@ -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(_)
Expand Down
3 changes: 3 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pub struct IndicesToIds {
data: Vec<DataId>,
locals: IdHashMap<Function, Vec<LocalId>>,
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 {
Expand Down

0 comments on commit 5276c4a

Please sign in to comment.