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

Function convert_module_globals

crates/parser/src/conversion.rs:108–120  ·  view source on GitHub ↗
(
    globals: wasmparser::SectionLimited<'_, wasmparser::Global<'_>>,
)

Source from the content-addressed store, hash-verified

106}
107
108pub(crate) fn convert_module_globals(
109 globals: wasmparser::SectionLimited<'_, wasmparser::Global<'_>>,
110) -> Result<Box<[Global]>> {
111 globals
112 .into_iter()
113 .map(|global| {
114 let global = global?;
115 let ty = convert_valtype(&global.ty.content_type)?;
116 let ops = global.init_expr.get_operators_reader();
117 Ok(Global { init: process_const_operators(ops)?, ty: GlobalType::new(ty, global.ty.mutable) })
118 })
119 .collect::<Result<Box<_>>>()
120}
121
122pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Export> {
123 let kind = match export.kind {

Callers 1

process_payloadMethod · 0.85

Calls 3

convert_valtypeFunction · 0.85
process_const_operatorsFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected