<rdar://problem/12503640> Fixing an issue where the dynamic type of an Objective-C pointer changed but we still reported the one-true-definition for the previous type. This was causing issues where a variable could be reported as being of an entirely different type after an assignment
llvm-svn: 166119
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 9debcc0..4db14dd 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -274,6 +274,13 @@
ClearUserVisibleData(eClearUserVisibleDataItemsValue);
}
+void
+ValueObject::ResetCompleteTypeInfo ()
+{
+ m_did_calculate_complete_objc_class_type = false;
+ m_override_type = ClangASTType();
+}
+
ClangASTType
ValueObject::MaybeCalculateCompleteType ()
{
diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp
index e3f27fc..b6d29d4 100644
--- a/lldb/source/Core/ValueObjectDynamicValue.cpp
+++ b/lldb/source/Core/ValueObjectDynamicValue.cpp
@@ -290,12 +290,14 @@
if (!m_type_sp)
{
m_type_sp = dynamic_type_sp;
+ ResetCompleteTypeInfo ();
}
else if (dynamic_type_sp != m_type_sp)
{
// We are another type, we need to tear down our children...
m_type_sp = dynamic_type_sp;
SetValueDidChange (true);
+ ResetCompleteTypeInfo ();
}
if (!m_address.IsValid() || m_address != dynamic_address)