Skip to content

Commit 63fc240

Browse files
author
bors-servo
authored
Auto merge of #179 - emilio:errors, r=fitzgen
Fix empty mangling handling on OSX This has hit @Manishearth today. r? @fitzgen
2 parents f967825 + 9eb1f76 commit 63fc240

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ir/function.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ pub fn cursor_mangling(cursor: &clang::Cursor) -> Option<String> {
9898
}
9999

100100
let mut mangling = cursor.mangling();
101+
if mangling.is_empty() {
102+
return None;
103+
}
101104

102105
// Try to undo backend linkage munging (prepended _, generally)
103106
if cfg!(target_os = "macos") {
104107
mangling.remove(0);
105108
}
106109

107-
if mangling.is_empty() { None } else { Some(mangling) }
110+
Some(mangling)
108111
}
109112

110113
impl FunctionSig {

0 commit comments

Comments
 (0)