From e6095b086f6e2429fb952ae75a193dc89b4b9082 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 13 Dec 2024 22:10:54 +0100 Subject: bf: add runtime check for data ptr over/underflow Fix bug to properly save callee-saved registers on jit entry and restore registers on jit exit. --- src/insn/cmp.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/insn/cmp.rs b/src/insn/cmp.rs index 2d6f48b..57e53eb 100644 --- a/src/insn/cmp.rs +++ b/src/insn/cmp.rs @@ -1,5 +1,5 @@ use super::Cmp; -use crate::{Asm, Imm16, Imm8, Mem16, Mem8}; +use crate::{Asm, Imm16, Imm8, Mem16, Mem8, Reg64}; impl Cmp for Asm { fn cmp(&mut self, op1: Mem8, op2: Imm8) { @@ -12,3 +12,9 @@ impl Cmp for Asm { self.encode_mi(0x81, 0x7, op1, op2); } } + +impl Cmp for Asm { + fn cmp(&mut self, op1: Reg64, op2: Reg64) { + self.encode_rr(&[0x3b], op1, op2); + } +} -- cgit v1.2.3