diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-21 20:14:04 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-21 20:25:19 +0200 |
| commit | 238e7aa76102cf64fa22ac5774326fcf35bc3792 (patch) | |
| tree | 50faea9c9fccdda22119c1b6bb38867cd9bf1dfd /crates/parser/src/conversion.rs | |
| parent | e667ae4554e816b4081d874fc3564b07c28dbec6 (diff) | |
feat: oom traps
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/conversion.rs')
| -rw-r--r-- | crates/parser/src/conversion.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index 5de3a73..08f3c83 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -1,3 +1,5 @@ +use alloc::sync::Arc; + use crate::{Result, module::Code, visit::process_operators_and_validate}; use alloc::{boxed::Box, format, string::ToString, vec::Vec}; use tinywasm_types::*; @@ -201,7 +203,7 @@ pub(crate) fn convert_module_code( Ok(((body, data, local_counts), allocations)) } -pub(crate) fn convert_module_type(ty: wasmparser::RecGroup) -> Result<FuncType> { +pub(crate) fn convert_module_type(ty: wasmparser::RecGroup) -> Result<Arc<FuncType>> { let mut types = ty.types(); if types.len() != 1 { return Err(crate::ParseError::UnsupportedOperator( @@ -212,7 +214,7 @@ pub(crate) fn convert_module_type(ty: wasmparser::RecGroup) -> Result<FuncType> let ty = types.next().unwrap().unwrap_func(); let params: Vec<_> = ty.params().iter().map(convert_valtype).collect(); let results: Vec<_> = ty.results().iter().map(convert_valtype).collect(); - Ok(FuncType::new(¶ms, &results)) + Ok(FuncType::new(¶ms, &results).into()) } pub(crate) fn convert_reftype(reftype: wasmparser::RefType) -> WasmType { |
