MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / convert_module_data

Function convert_module_data

crates/parser/src/conversion.rs:44–56  ·  view source on GitHub ↗
(data: wasmparser::Data<'_>)

Source from the content-addressed store, hash-verified

42}
43
44pub(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
58pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result<Import> {
59 let kind = match import.ty {

Callers 1

process_payloadMethod · 0.85

Calls 1

process_const_operatorsFunction · 0.85

Tested by

no test coverage detected