Use the correct base address for memories.

This commit is contained in:
Dan Gohman
2018-11-02 16:18:18 -07:00
parent 8e114a2703
commit d72ebe53d4

View File

@@ -290,7 +290,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
let new_base = func.create_global_value(ir::GlobalValueData::VMContext { let new_base = func.create_global_value(ir::GlobalValueData::VMContext {
offset: Offset32::new(pointer_bytes as i32), offset: Offset32::new(pointer_bytes as i32),
}); });
self.globals_base = Some(new_base); self.memories_base = Some(new_base);
new_base new_base
}); });
let offset = index * pointer_bytes; let offset = index * pointer_bytes;