diff --git a/src/jit.rs b/src/jit.rs index 7a525aaf..6fa0d725 100644 --- a/src/jit.rs +++ b/src/jit.rs @@ -1086,18 +1086,18 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> { let stack_slot_of_value_to_store = X86IndirectAccess::OffsetIndexShift(-112, RSP, 0); match value { Some(Value::Register(reg)) => { - self.emit_ins(X86Instruction::mov(OperandSize::S64, reg, REGISTER_OTHER_SCRATCH)); + self.emit_ins(X86Instruction::store(OperandSize::S64, reg, RSP, stack_slot_of_value_to_store)); } Some(Value::Constant64(constant, user_provided)) => { if user_provided && self.should_sanitize_constant(constant) { - self.emit_sanitized_load_immediate(OperandSize::S64, REGISTER_OTHER_SCRATCH, constant); + self.emit_sanitized_load_immediate(OperandSize::S64, REGISTER_SCRATCH, constant); } else { - self.emit_ins(X86Instruction::load_immediate(OperandSize::S64, REGISTER_OTHER_SCRATCH, constant)); + self.emit_ins(X86Instruction::load_immediate(OperandSize::S64, REGISTER_SCRATCH, constant)); } + self.emit_ins(X86Instruction::store(OperandSize::S64, REGISTER_SCRATCH, RSP, stack_slot_of_value_to_store)); } _ => {} } - self.emit_ins(X86Instruction::store(OperandSize::S64, REGISTER_OTHER_SCRATCH, RSP, stack_slot_of_value_to_store)); match vm_addr { Value::RegisterPlusConstant64(reg, constant, user_provided) => {