Fixed casting in the lldb::SBValue::Cast(SBType) function.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149673 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 96182e3..58a718b 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -378,8 +378,8 @@
 SBValue::Cast (SBType type)
 {
     lldb::SBValue sb_value;
-    if (m_opaque_sp)
-        sb_value = CreateChildAtOffset(m_opaque_sp->GetName().GetCString(), 0, type);
+    if (m_opaque_sp && type.IsValid())
+        *sb_value = m_opaque_sp->Cast(type.ref().GetClangASTType());
     return sb_value;
 }