diff options
Diffstat (limited to 'crates/parser/src')
| -rw-r--r-- | crates/parser/src/conversion.rs | 4 | ||||
| -rw-r--r-- | crates/parser/src/module.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index dfd5415..63a42b2 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -86,7 +86,7 @@ pub(crate) fn convert_module_import(import: wasmparser::Import<'_>) -> Result<Im }), wasmparser::TypeRef::Memory(ty) => ImportKind::Memory(convert_module_memory(ty)), wasmparser::TypeRef::Global(ty) => { - ImportKind::Global(GlobalType { mutable: ty.mutable, ty: convert_valtype(&ty.content_type) }) + ImportKind::Global(GlobalType::new(convert_valtype(&ty.content_type), ty.mutable)) } wasmparser::TypeRef::Tag(ty) => { return Err(crate::ParseError::UnsupportedOperator(format!("Unsupported import kind: {ty:?}"))); @@ -140,7 +140,7 @@ pub(crate) fn convert_module_globals( let global = global?; let ty = convert_valtype(&global.ty.content_type); let ops = global.init_expr.get_operators_reader(); - Ok(Global { init: process_const_operators(ops)?, ty: GlobalType { mutable: global.ty.mutable, ty } }) + Ok(Global { init: process_const_operators(ops)?, ty: GlobalType::new(ty, global.ty.mutable) }) }) .collect::<Result<Vec<_>>>() } diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index b53dfd6..8405c6d 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -158,9 +158,9 @@ impl ModuleReader { validator.end(offset)?; self.end_reached = true; } - Payload::CustomSection(_reader) => { + Payload::CustomSection(reader) => { debug!("Found custom section"); - debug!("Skipping custom section: {:?}", _reader.name()); + debug!("Skipping custom section: {:?}", reader.name()); } Payload::UnknownSection { .. } => return Err(ParseError::UnsupportedSection("Unknown section".into())), section => return Err(ParseError::UnsupportedSection(format!("Unsupported section: {section:?}"))), |
