diff --git a/src/interpreter/global.rs b/src/interpreter/global.rs index 684aeaf..5137c53 100644 --- a/src/interpreter/global.rs +++ b/src/interpreter/global.rs @@ -1,6 +1,6 @@ use std::rc::Rc; use std::cell::Cell; -use elements::{ValueType, GlobalType}; +use elements::ValueType; use interpreter::value::RuntimeValue; use interpreter::Error; @@ -22,8 +22,8 @@ pub struct GlobalInstance { impl GlobalInstance { - pub fn alloc(global_type: &GlobalType, val: RuntimeValue) -> GlobalRef { - let global = GlobalInstance::new(val, global_type.is_mutable()); + pub fn alloc(val: RuntimeValue, mutable: bool) -> GlobalRef { + let global = GlobalInstance::new(val, mutable); GlobalRef(Rc::new(global)) } diff --git a/src/interpreter/module.rs b/src/interpreter/module.rs index 2aba006..4881f31 100644 --- a/src/interpreter/module.rs +++ b/src/interpreter/module.rs @@ -259,7 +259,10 @@ impl ModuleInstance { ) { let init_val = eval_init_expr(global_entry.init_expr(), &*instance); - let global = GlobalInstance::alloc(global_entry.global_type(), init_val); + let global = GlobalInstance::alloc( + init_val, + global_entry.global_type().is_mutable(), + ); instance.push_global(global); }