mirror of
https://github.com/encounter/objdiff.git
synced 2025-10-05 01:19:49 +00:00
Detect x86 instruction size differences
Check raw code length when instructions have same disassembly but different encodings. Marks as OpMismatch to indicate encoding difference. Fixes #242 Fixes #233
This commit is contained in:
parent
58430d947b
commit
8d24ec6373
@ -496,6 +496,14 @@ fn diff_instruction(
|
||||
result.right_args_diff.push(InstructionArgDiffIndex::new(b_diff));
|
||||
}
|
||||
}
|
||||
if result.kind == InstructionDiffKind::None
|
||||
&& left_resolved.code.len() != right_resolved.code.len()
|
||||
{
|
||||
// If everything else matches but the raw code length differs (e.g. x86 instructions
|
||||
// with same disassembly but different encoding), mark as op mismatch
|
||||
result.kind = InstructionDiffKind::OpMismatch;
|
||||
state.diff_score += PENALTY_REG_DIFF;
|
||||
}
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user