Skip to content

Fix x86 MOV operand structure comparison - #428

Closed
sean0407 wants to merge 2 commits into
encounter:mainfrom
sean0407:codex/objdiff-416-mov-operand-comparison-20261020
Closed

sean0407 wants to merge 2 commits into
encounter:mainfrom
sean0407:codex/objdiff-416-mov-operand-comparison-20261020

Conversation

@sean0407

Copy link
Copy Markdown

Summary

x86 formatted operands -> comparison key -> instruction diff

Preserve x86 operand punctuation and argument positions in instruction comparisons, so mov eax, [ebx] and mov [eax], ebx are no longer treated as equivalent. Fixes #416.

Evidence

  • Before: reproducing the reported byte sequences (8b 03 and 89 18) produced matching decoded argument values, so the distinct memory/register operand layouts were treated as equal.
  • After: added a regression test confirming the two x86 instructions produce distinct comparison keys; the diff path reports an argument mismatch when keys differ.
  • Checks: cargo test --offline -p objdiff-core passed; cargo +nightly clippy --offline -p objdiff-core --all-targets --all-features -- -D warnings passed; Nightly rustfmt check and git diff --check passed.
  • Files: objdiff-core/src/arch/mod.rs, objdiff-core/src/arch/x86.rs, objdiff-core/src/diff/code.rs.

Merge Danger

Door: Two-way

Blast Radius: Low

The comparison key is opt-in by architecture and overridden only for x86 in this change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T19:06:44.063934Z 34038e5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34038e58ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

&self,
resolved: ResolvedInstructionRef,
diff_config: &DiffObjConfig,
) -> Result<Option<Vec<String>>> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Import String for the no-std WASM build

The documented WASM build uses objdiff-wasm, whose Cargo.toml:29-32 disables objdiff-core's default features while enabling x86, so this module is compiled with the core prelude rather than the std prelude. Because x86.rs does not import alloc::string::String, this new Vec<String> signature fails with cannot find type String in this scope and blocks the web artifact; import String from alloc.

AGENTS.md reference: AGENTS.md:L23-L23

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x86: mov eax, [ebx] is treated the same as mov [eax], ebx

2 participants