diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-20 19:26:44 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-20 19:26:44 +0100 |
| commit | 7b456a58f70c0a1dbaf289d285b14a6b139495f7 (patch) | |
| tree | fcdd1e9b3e6f2c3d066cb1f8791bd7796d2c982d /crates/parser | |
| parent | 032d2cdd590c1cdd30490384742a90dc0c759176 (diff) | |
feat: typed host funcs
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser')
| -rw-r--r-- | crates/parser/src/lib.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 3667f1d..0618683 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -23,7 +23,7 @@ mod module; use alloc::vec::Vec; pub use error::*; use module::ModuleReader; -use tinywasm_types::{Function, WasmFunction}; +use tinywasm_types::WasmFunction; use wasmparser::Validator; pub use tinywasm_types::TinyWasmModule; @@ -108,12 +108,10 @@ impl TryFrom<ModuleReader> for TinyWasmModule { .code .into_iter() .zip(func_types) - .map(|(f, ty)| { - Function::WasmFunction(WasmFunction { - instructions: f.body, - locals: f.locals, - ty, - }) + .map(|(f, ty)| WasmFunction { + instructions: f.body, + locals: f.locals, + ty_addr: ty, }) .collect::<Vec<_>>(); |
