Also wasn't it an #ifdef _MSC_VER?  I'm curious how you found an error in that branch if you're running on mac.  The code was working for me on Windows.<br><br>Either way I'll double check tomorrow <br><div class="gmail_quote">On Wed, Jan 14, 2015 at 7:40 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Err, was that code wrong?  I malloc it unconditionally, so it should be freed unconditionally (don't have source in front of me, so I'm going from memory)<br><div class="gmail_quote">On Wed, Jan 14, 2015 at 7:36 PM Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jingham<br>
Date: Wed Jan 14 21:34:31 2015<br>
New Revision: 226088<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226088&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u>oject?rev=226088&view=rev</a><br>
Log:<br>
Fix a little thinko in r226017 - the code to actually add the demangled name to the Mangled object got<br>
moved into the #else branch of the #if/#elif/#endif, so it wasn't getting done in the #if case anymore.<br>
<br>
Keep the code to add the demangled name outside of the #if, and then just free the demangled_name<br>
and set it back to NULL in the Windows case.<br>
<br>
<rdar://problem/19479499><br>
<br>
Modified:<br>
    lldb/trunk/source/Core/<u></u>Mangled<u></u>.cpp<br>
<br>
Modified: lldb/trunk/source/Core/<u></u>Mangled<u></u>.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=226088&r1=226087&r2=226088&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u>oject/lldb/trunk/source/<u></u>Core/<u></u>Mangled.cpp?rev=226088&<u></u>r1=<u></u>226087&r2=226088&view=diff</a><br>
==============================<u></u><u></u>==============================<u></u><u></u>==================<br>
--- lldb/trunk/source/Core/<u></u>Mangled<u></u>.cpp (original)<br>
+++ lldb/trunk/source/Core/<u></u>Mangled<u></u>.cpp Wed Jan 14 21:34:31 2015<br>
@@ -5240,18 +5240,20 @@ Mangled::GetDemangledName () const<br>
                                                           UNDNAME_NO_MEMBER_TYPE |         // Strip virtual, static, etc specifiers<br>
                                                           UNDNAME_NO_MS_KEYWORDS           // Strip all MS extension keywords<br>
                                                       );<br>
-                if (result > 0)<br>
-                    m_demangled.<u></u>SetCStringWithMang<u></u>ledCounterpa<u></u>rt(demangled_name, m_mangled);<br>
-                free(demangled_name);<br>
+                if (result == 0)<br>
+                {<br>
+                    free (demangled_name);<br>
+                    demangled_name = nullptr;<br>
+                }<br>
 #else<br>
                 char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);<br>
+#endif<br>
<br>
                 if (demangled_name)<br>
                 {<br>
                     m_demangled.<u></u>SetCStringWithMan<u></u>gledCounterpa<u></u>rt(demangled_<u></u>name, m_mangled);<br>
                     free (demangled_name);<br>
                 }<br>
-#endif<br>
             }<br>
         }<br>
         if (!m_demangled)<br>
<br>
<br>
______________________________<u></u><u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/lldb-commits</a><br>
</blockquote></div></blockquote></div>