Check relocation addends when diffing functions (#158)

* Check relocation addends when diffing functions

* Also highlight addend when reloc differs
This commit is contained in:
LagoLunatic
2025-02-10 00:26:49 -05:00
committed by GitHub
parent 674c942d7d
commit 3e6efb7736
5 changed files with 53 additions and 34 deletions

View File

@@ -324,6 +324,18 @@ fn diff_text_ui(
base_color = appearance.emphasized_text_color;
}
}
DiffText::Addend(addend, diff) => {
label_text = match addend.cmp(&0i64) {
Ordering::Greater => format!("+{:#x}", addend),
Ordering::Less => format!("-{:#x}", -addend),
_ => "".to_string(),
};
if let Some(diff) = diff {
base_color = appearance.diff_colors[diff.idx % appearance.diff_colors.len()]
} else {
base_color = appearance.emphasized_text_color;
}
}
DiffText::Spacing(n) => {
ui.add_space(n as f32 * space_width);
return ret;