[Lldb-commits] [lldb] r149345 - /lldb/trunk/source/API/SBValue.cpp

Greg Clayton gclayton at apple.com
Mon Jan 30 20:25:15 PST 2012


Author: gclayton
Date: Mon Jan 30 22:25:15 2012
New Revision: 149345

URL: http://llvm.org/viewvc/llvm-project?rev=149345&view=rev
Log:
<rdar://problem/10776614>

Fixed an issue where we can crash if you call cast when the SBValue
doesn't contain a valid value.


Modified:
    lldb/trunk/source/API/SBValue.cpp

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=149345&r1=149344&r2=149345&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Mon Jan 30 22:25:15 2012
@@ -377,7 +377,10 @@
 lldb::SBValue
 SBValue::Cast (SBType type)
 {
-    return CreateChildAtOffset(m_opaque_sp->GetName().GetCString(), 0, type);
+    lldb::SBValue sb_value;
+    if (m_opaque_sp)
+        sb_value = CreateChildAtOffset(m_opaque_sp->GetName().GetCString(), 0, type);
+    return sb_value;
 }
 
 lldb::SBValue





More information about the lldb-commits mailing list