diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2023-12-19 14:37:51 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2023-12-19 14:37:51 +0100 |
| commit | 375f9aa32b117a42c7a9c7f29d3c592b81d966be (patch) | |
| tree | 4673abc196c01435578d6594c30e5987298dd325 /crates/parser/src/lib.rs | |
| parent | 820ecb429f57053098684e209b8a3a00cb0ac973 (diff) | |
feat: parse memory and table sections
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/lib.rs')
| -rw-r--r-- | crates/parser/src/lib.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index bcaef76..36deb7f 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -102,9 +102,9 @@ impl TryFrom<ModuleReader> for TinyWasmModule { return Err(ParseError::EndNotReached); } - let func_types = reader.function_section; + let func_types = reader.func_addrs; let funcs = reader - .code_section + .code .into_iter() .zip(func_types) .map(|(f, ty)| Function { @@ -114,15 +114,18 @@ impl TryFrom<ModuleReader> for TinyWasmModule { }) .collect::<Vec<_>>(); - let globals = reader.global_section; + let globals = reader.globals; + let table_types = reader.table_types; Ok(TinyWasmModule { version: reader.version, start_func: reader.start_func, - types: reader.type_section.into_boxed_slice(), + func_types: reader.func_types.into_boxed_slice(), funcs: funcs.into_boxed_slice(), - exports: reader.export_section.into_boxed_slice(), + exports: reader.exports.into_boxed_slice(), globals: globals.into_boxed_slice(), + table_types: table_types.into_boxed_slice(), + memory_types: reader.memory_types.into_boxed_slice(), }) } } |
