From f932bccaf8f8eb6350083429cf8d17c1503943db Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 6 Jul 2020 18:43:34 +0200 Subject: [PATCH] machinst x64: fix sign-extension at boundary --- cranelift/codegen/src/isa/x64/abi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cranelift/codegen/src/isa/x64/abi.rs b/cranelift/codegen/src/isa/x64/abi.rs index 4444edafc3..173cd426ee 100644 --- a/cranelift/codegen/src/isa/x64/abi.rs +++ b/cranelift/codegen/src/isa/x64/abi.rs @@ -295,14 +295,14 @@ impl ABIBody for X64ABIBody { (ArgumentExtension::Uext, Some(ext_mode)) => { ret.push(Inst::movzx_rm_r( ext_mode, - RegMem::reg(r.to_reg()), + RegMem::reg(from_reg.to_reg()), dest_reg, )); } (ArgumentExtension::Sext, Some(ext_mode)) => { ret.push(Inst::movsx_rm_r( ext_mode, - RegMem::reg(r.to_reg()), + RegMem::reg(from_reg.to_reg()), dest_reg, )); }