Fix a little thinko in r226017 - the code to actually add the demangled name to the Mangled object got
moved into the #else branch of the #if/#elif/#endif, so it wasn't getting done in the #if case anymore.
Keep the code to add the demangled name outside of the #if, and then just free the demangled_name
and set it back to NULL in the Windows case.
<rdar://problem/19479499>
llvm-svn: 226088
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp
index c9d0953..60e4717 100644
--- a/lldb/source/Core/Mangled.cpp
+++ b/lldb/source/Core/Mangled.cpp
@@ -5240,18 +5240,20 @@
UNDNAME_NO_MEMBER_TYPE | // Strip virtual, static, etc specifiers
UNDNAME_NO_MS_KEYWORDS // Strip all MS extension keywords
);
- if (result > 0)
- m_demangled.SetCStringWithMangledCounterpart(demangled_name, m_mangled);
- free(demangled_name);
+ if (result == 0)
+ {
+ free (demangled_name);
+ demangled_name = nullptr;
+ }
#else
char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
+#endif
if (demangled_name)
{
m_demangled.SetCStringWithMangledCounterpart(demangled_name, m_mangled);
free (demangled_name);
}
-#endif
}
}
if (!m_demangled)