[Lldb-commits] [lldb] r113900 - /lldb/trunk/source/Core/Mangled.cpp

Greg Clayton gclayton at apple.com
Tue Sep 14 16:48:44 PDT 2010


Author: gclayton
Date: Tue Sep 14 18:48:44 2010
New Revision: 113900

URL: http://llvm.org/viewvc/llvm-project?rev=113900&view=rev
Log:
Fixed a case where Mangled::GetName(...) could return a invalid demangled name when one could be calculated.

Modified:
    lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=113900&r1=113899&r2=113900&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Tue Sep 14 18:48:44 2010
@@ -218,17 +218,17 @@
 {
     if (preference == ePreferDemangled)
     {
-        const ConstString& name = GetDemangledName();
-        if (name && !name.IsEmpty())
-            return name;
+        // Call the accessor to make sure we get a demangled name in case
+        // it hasn't been demangled yet...
+        if (GetDemangledName())
+            return m_demangled;
         return m_mangled;
     }
     else
     {
-        const ConstString& name = GetMangledName();
-        if (name && !name.IsEmpty())
-            return name;
-        return m_demangled;
+        if (m_mangled)
+            return m_mangled;
+        return GetDemangledName();
     }
 }
 





More information about the lldb-commits mailing list