Change GlobalInit::Import() to GlobalInit::Import.
This commit is contained in:
@@ -95,7 +95,7 @@ pub fn parse_import_section<'data>(
|
|||||||
Global {
|
Global {
|
||||||
ty: type_to_type(ty.content_type).unwrap(),
|
ty: type_to_type(ty.content_type).unwrap(),
|
||||||
mutability: ty.mutable,
|
mutability: ty.mutable,
|
||||||
initializer: GlobalInit::Import(),
|
initializer: GlobalInit::Import,
|
||||||
},
|
},
|
||||||
module_name,
|
module_name,
|
||||||
field_name,
|
field_name,
|
||||||
@@ -253,7 +253,7 @@ pub fn parse_element_section<'data>(
|
|||||||
.initializer
|
.initializer
|
||||||
{
|
{
|
||||||
GlobalInit::I32Const(value) => (None, value as u32 as usize),
|
GlobalInit::I32Const(value) => (None, value as u32 as usize),
|
||||||
GlobalInit::Import() => (Some(GlobalIndex::new(global_index as usize)), 0),
|
GlobalInit::Import => (Some(GlobalIndex::new(global_index as usize)), 0),
|
||||||
_ => panic!("should not happen"),
|
_ => panic!("should not happen"),
|
||||||
},
|
},
|
||||||
ref s => panic!("unsupported init expr in element section: {:?}", s),
|
ref s => panic!("unsupported init expr in element section: {:?}", s),
|
||||||
@@ -301,7 +301,7 @@ pub fn parse_data_section<'data>(
|
|||||||
.initializer
|
.initializer
|
||||||
{
|
{
|
||||||
GlobalInit::I32Const(value) => (None, value as u32 as usize),
|
GlobalInit::I32Const(value) => (None, value as u32 as usize),
|
||||||
GlobalInit::Import() => (Some(GlobalIndex::new(global_index as usize)), 0),
|
GlobalInit::Import => (Some(GlobalIndex::new(global_index as usize)), 0),
|
||||||
_ => panic!("should not happen"),
|
_ => panic!("should not happen"),
|
||||||
},
|
},
|
||||||
ref s => panic!("unsupported init expr in data section: {:?}", s),
|
ref s => panic!("unsupported init expr in data section: {:?}", s),
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ pub enum GlobalInit {
|
|||||||
/// A `get_global` of another global.
|
/// A `get_global` of another global.
|
||||||
GlobalRef(GlobalIndex),
|
GlobalRef(GlobalIndex),
|
||||||
///< The global is imported from, and thus initialized by, a different module.
|
///< The global is imported from, and thus initialized by, a different module.
|
||||||
Import(),
|
Import,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// WebAssembly table.
|
/// WebAssembly table.
|
||||||
|
|||||||
Reference in New Issue
Block a user