(data: wasmparser::Data<'_>)
| 42 | } |
| 43 | |
| 44 | pub(crate) fn convert_module_data(data: wasmparser::Data<'_>) -> Result<tinywasm_types::Data> { |
| 45 | Ok(tinywasm_types::Data { |
| 46 | data: data.data.to_vec().into_boxed_slice(), |
| 47 | range: data.range, |
| 48 | kind: match data.kind { |
| 49 | wasmparser::DataKind::Active { memory_index, offset_expr } => { |
| 50 | let offset = process_const_operators(offset_expr.get_operators_reader())?; |
| 51 | tinywasm_types::DataKind::Active { mem: memory_index, offset } |
| 52 | } |
| 53 | wasmparser::DataKind::Passive => tinywasm_types::DataKind::Passive, |
| 54 | }, |
| 55 | }) |
| 56 | } |
| 57 | |
| 58 | pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result<Import> { |
| 59 | let kind = match import.ty { |
no test coverage detected