From 4c5092e2a23825f3cdccaf264a6bd3adf1c3f8ac Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 21 Feb 2026 14:19:55 +0000 Subject: visit flags changes, tests caught a bug! --- src/long_mode/behavior.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/long_mode/behavior.rs b/src/long_mode/behavior.rs index 7e48936..1626948 100644 --- a/src/long_mode/behavior.rs +++ b/src/long_mode/behavior.rs @@ -349,6 +349,15 @@ impl<'inst> InstBehavior<'inst> { } } + if let Some(acc) = self.flags_access() { + if acc.is_read() { + v.register_read(RegSpec::rflags()); + } + if acc.is_write() { + v.register_write(RegSpec::rflags()); + } + } + let operand_access = self.behavior.operand_access; for i in 0..self.inst.operand_count { @@ -770,7 +779,7 @@ const GENERAL_RW_R_FLAGWRITE: BehaviorDigest = GENERAL_RW_R /// test, cmp, with no write but to flags. const GENERAL_R_R_FLAGWRITE: BehaviorDigest = GENERAL_RW_R - .set_operand(0, Access::ReadWrite) + .set_operand(0, Access::Read) .set_flags_access(Access::Write); /// `sbb`, `adc`, etc both read flags and write them. -- cgit v1.1