From 34038e58cebccea6c90e98c1a02c31527dc54619 Mon Sep 17 00:00:00 2001
From: Sean Li <22557931+sean0407@users.noreply.github.com>
Date: Tue, 20 Oct 2026 02:56:57 +0800
Subject: [PATCH 1/2] fix: compare x86 operand structure in diffs
---
objdiff-core/src/arch/mod.rs | 10 ++++++++
objdiff-core/src/arch/x86.rs | 46 +++++++++++++++++++++++++++++++++++
objdiff-core/src/diff/code.rs | 9 +++++++
3 files changed, 65 insertions(+)
diff --git a/objdiff-core/src/arch/mod.rs b/objdiff-core/src/arch/mod.rs
index fa41a744..3d54ed1d 100644
--- a/objdiff-core/src/arch/mod.rs
+++ b/objdiff-core/src/arch/mod.rs
@@ -420,6 +420,16 @@ pub trait Arch: Any + Debug + Send + Sync {
cb: &mut dyn FnMut(InstructionPart) -> Result<()>,
) -> Result<()>;
+ /// Return formatting-token structure that must match for two instructions to be considered equal.
+ /// Architectures that encode operand structure in their formatted output can override this.
+ fn instruction_comparison_key(
+ &self,
+ _resolved: ResolvedInstructionRef,
+ _diff_config: &DiffObjConfig,
+ ) -> Result