From 940a46d0ba4b9d833e3670f699ba48cf4782ee8b Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 12 Feb 2023 11:43:39 -0800 Subject: fix xbegin/xend (broken in DecodeCtx::rrr) --- src/long_mode/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 30440c6..ad7a782 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -7200,7 +7200,7 @@ fn read_operands< }, OperandCase::MovI8 => { if self.rrr != 0 { - if mem_oper == OperandSpec::RegMMM && self.rrr == 0 { + if mem_oper == OperandSpec::RegMMM && instruction.regs[1].num & 0b0111 == 0 { instruction.opcode = Opcode::XABORT; instruction.imm = read_imm_signed(words, 1)? as u64; sink.record( @@ -7237,7 +7237,7 @@ fn read_operands< OperandCase::MovIv => { let opwidth = instruction.regs[0].bank as u8; if self.rrr != 0 { - if mem_oper == OperandSpec::RegMMM && self.rrr == 0 { + if mem_oper == OperandSpec::RegMMM && instruction.regs[1].num & 0b0111 == 0 { instruction.opcode = Opcode::XBEGIN; instruction.imm = if opwidth == 2 { let imm = read_imm_signed(words, 2)? as i16 as i64 as u64; -- cgit v1.1