mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-09 13:37:55 +00:00
Adjust symbol name matching logic for GCC (#278)
* Adjust symbol name matching logic for GCC * Turn $ and . into a list * Fix borrow issue
This commit is contained in:
@@ -37,12 +37,13 @@ pub fn diff_bss_symbol(
|
||||
|
||||
pub fn symbol_name_matches(left_name: &str, right_name: &str) -> bool {
|
||||
// Match Metrowerks symbol$1234 against symbol$2345
|
||||
if let Some((prefix, suffix)) = left_name.split_once('$') {
|
||||
// and GCC symbol.1234 against symbol.2345
|
||||
if let Some((prefix, suffix)) = left_name.split_once(['$', '.']) {
|
||||
if !suffix.chars().all(char::is_numeric) {
|
||||
return false;
|
||||
}
|
||||
right_name
|
||||
.split_once('$')
|
||||
.split_once(['$', '.'])
|
||||
.is_some_and(|(p, s)| p == prefix && s.chars().all(char::is_numeric))
|
||||
} else {
|
||||
left_name == right_name
|
||||
|
||||
Reference in New Issue
Block a user