(
globals: wasmparser::SectionLimited<'_, wasmparser::Global<'_>>,
)
| 106 | } |
| 107 | |
| 108 | pub(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 | |
| 122 | pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Export> { |
| 123 | let kind = match export.kind { |
no test coverage detected