From 9eb1f76ffd73e350ee6478aa2677c29affc5d0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 1 Nov 2016 00:08:44 +0100 Subject: [PATCH] Fix empty mangling handling on OSX --- src/ir/function.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ir/function.rs b/src/ir/function.rs index fc2a7110c3..e9fd4a2505 100644 --- a/src/ir/function.rs +++ b/src/ir/function.rs @@ -98,13 +98,16 @@ pub fn cursor_mangling(cursor: &clang::Cursor) -> Option { } let mut mangling = cursor.mangling(); + if mangling.is_empty() { + return None; + } // Try to undo backend linkage munging (prepended _, generally) if cfg!(target_os = "macos") { mangling.remove(0); } - if mangling.is_empty() { None } else { Some(mangling) } + Some(mangling) } impl FunctionSig {