From 72b6123def778de441614422ab4fee41ab378f9b Mon Sep 17 00:00:00 2001 From: losfair Date: Wed, 18 Sep 2019 02:38:35 +0800 Subject: [PATCH] Fix memory grow --- lib/singlepass-backend/src/codegen_x64.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/singlepass-backend/src/codegen_x64.rs b/lib/singlepass-backend/src/codegen_x64.rs index 224ca4b47..260a0f667 100644 --- a/lib/singlepass-backend/src/codegen_x64.rs +++ b/lib/singlepass-backend/src/codegen_x64.rs @@ -4167,7 +4167,13 @@ impl FunctionCodeGenerator for X64FunctionCode { a, &mut self.machine, |a| { - a.emit_call_location(Location::GPR(GPR::RAX)); + let label = a.get_label(); + let after = a.get_label(); + a.emit_jmp(Condition::None, after); + a.emit_label(label); + a.emit_homomorphic_host_redirection(GPR::RAX); + a.emit_label(after); + a.emit_call_label(label); }, ::std::iter::once(Location::Imm32(memory_index.index() as u32)) .chain(::std::iter::once(param_pages)),