Match BranchDest->Reloc with relaxed relocation diffs

This commit is contained in:
Luke Street 2024-10-31 17:24:33 -06:00
parent 21f8f2407c
commit 79bd7317c1
1 changed files with 10 additions and 4 deletions

View File

@ -259,11 +259,17 @@ fn arg_eq(
right_diff.ins.as_ref().and_then(|i| i.reloc.as_ref()),
)
}
ObjInsArg::BranchDest(_) => {
ObjInsArg::BranchDest(_) => match right {
// Compare dest instruction idx after diffing
left_diff.branch_to.as_ref().map(|b| b.ins_idx)
== right_diff.branch_to.as_ref().map(|b| b.ins_idx)
}
ObjInsArg::BranchDest(_) => {
left_diff.branch_to.as_ref().map(|b| b.ins_idx)
== right_diff.branch_to.as_ref().map(|b| b.ins_idx)
}
// If relocations are relaxed, match if left is a constant and right is a reloc
// Useful for instances where the target object is created without relocations
ObjInsArg::Reloc => config.relax_reloc_diffs,
_ => false,
},
}
}