Skip to content

Commit a63e658

Browse files
committed
address feedback
1 parent 25069e5 commit a63e658

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

objdiff-core/src/obj/read.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ fn get_normalized_symbol_name(name: &str) -> Option<String> {
6161
{
6262
// Match GCC symbol.1234 against symbol.2345
6363
Some(format!("{prefix}.{DUMMY_UNIQUE_ID}"))
64-
} else {
65-
let re = Regex::new(r"\?A0x[0-9A-Fa-f]{8}@@").unwrap();
64+
} else if name.starts_with('?') {
6665
// Match MSVC anonymous class symbol names, ignoring the unique ID.
6766
// e.g. ?CheckContextOr@?A0x24773155@@YA_NPBVDataArray@@@Z
6867
// and: ?CheckContextOr@?A0xddf6240c@@YA_NPBVDataArray@@@Z
69-
if name.starts_with('?') && re.is_match(name) {
70-
Some(re.replace_all(name, format!("?Ax{DUMMY_UNIQUE_MSVC_ID}@@")).to_string())
68+
let re = Regex::new(r"\?A0x[0-9A-Fa-f]{8}@@").unwrap();
69+
if re.is_match(name) {
70+
Some(re.replace_all(name, format!("?A0x{DUMMY_UNIQUE_MSVC_ID}@@")).to_string())
7171
} else {
7272
None
7373
}
74+
} else {
75+
None
7476
}
7577
}
7678

0 commit comments

Comments
 (0)