mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-03-15 11:10:49 +00:00
table and memory
This commit is contained in:
parent
be40285a67
commit
dd9169e30f
19
src/graph.rs
19
src/graph.rs
@ -125,6 +125,22 @@ impl Module {
|
||||
});
|
||||
};
|
||||
},
|
||||
elements::Section::Table(table_section) => {
|
||||
for t in table_section.entries() {
|
||||
res.tables.push(Table {
|
||||
limits: t.limits().clone(),
|
||||
origin: ImportedOrDeclared::Declared(()),
|
||||
});
|
||||
}
|
||||
},
|
||||
elements::Section::Memory(table_section) => {
|
||||
for t in table_section.entries() {
|
||||
res.memory.push(Memory {
|
||||
limits: t.limits().clone(),
|
||||
origin: ImportedOrDeclared::Declared(()),
|
||||
});
|
||||
}
|
||||
},
|
||||
_ => continue,
|
||||
}
|
||||
}
|
||||
@ -150,6 +166,7 @@ mod tests {
|
||||
(module
|
||||
(type (func))
|
||||
(func (type 0))
|
||||
(memory 0 1)
|
||||
)
|
||||
"#).expect("Failed to read fixture");
|
||||
|
||||
@ -157,5 +174,7 @@ mod tests {
|
||||
|
||||
assert_eq!(f.types.len(), 1);
|
||||
assert_eq!(f.funcs.len(), 1);
|
||||
assert_eq!(f.tables.len(), 0);
|
||||
assert_eq!(f.memory.len(), 1);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user