Skip to content

Commit e101610

Browse files
authored
ARM: Fix subtract with overflow error when no mapping symbol at address 0 (#183)
1 parent 196c003 commit e101610

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

objdiff-core/src/arch/arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl Arch for ArchArm {
199199
.unwrap_or(&fallback_mappings);
200200
let first_mapping_idx = mapping_symbols
201201
.binary_search_by_key(&start_addr, |x| x.address)
202-
.unwrap_or_else(|idx| idx - 1);
202+
.unwrap_or_else(|idx| idx.saturating_sub(1));
203203
let mut mode = mapping_symbols[first_mapping_idx].mapping;
204204

205205
let mut mappings_iter = mapping_symbols

0 commit comments

Comments
 (0)