ARM: Fix subtract with overflow error when no mapping symbol at address 0 (#183)

This commit is contained in:
LagoLunatic 2025-03-31 00:00:06 -04:00 committed by GitHub
parent 196c003a92
commit e101610416
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -199,7 +199,7 @@ impl Arch for ArchArm {
.unwrap_or(&fallback_mappings); .unwrap_or(&fallback_mappings);
let first_mapping_idx = mapping_symbols let first_mapping_idx = mapping_symbols
.binary_search_by_key(&start_addr, |x| x.address) .binary_search_by_key(&start_addr, |x| x.address)
.unwrap_or_else(|idx| idx - 1); .unwrap_or_else(|idx| idx.saturating_sub(1));
let mut mode = mapping_symbols[first_mapping_idx].mapping; let mut mode = mapping_symbols[first_mapping_idx].mapping;
let mut mappings_iter = mapping_symbols let mut mappings_iter = mapping_symbols