Skip to content

Commit 9c8240d

Browse files
committed
Fix TestObjCIvarDiscovery.py, it looks like a swift mod block was lost during a merge
1 parent 52df6ad commit 9c8240d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lldb/source/Core/ValueObjectChild.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,19 @@ bool ValueObjectChild::UpdateValue() {
156156
m_value.SetValueType(Value::ValueType::FileAddress);
157157
} break;
158158
case eAddressTypeLoad:
159-
m_value.SetValueType(is_instance_ptr_base
160-
? Value::ValueType::Scalar
161-
: Value::ValueType::LoadAddress);
159+
// BEGIN SWIFT MOD
160+
// We need to detect when we cross TypeSystem boundaries,
161+
// e.g. when we try to print Obj-C fields of a Swift object.
162+
if (parent->GetCompilerType().GetTypeSystem()->SupportsLanguage(
163+
lldb::eLanguageTypeSwift) &&
164+
GetCompilerType().GetTypeSystem()->SupportsLanguage(
165+
lldb::eLanguageTypeSwift))
166+
m_value.SetValueType(is_instance_ptr_base
167+
? Value::ValueType::Scalar
168+
: Value::ValueType::LoadAddress);
169+
else
170+
m_value.SetValueType(Value::ValueType::LoadAddress);
171+
// END SWIFT MOD
162172
break;
163173
case eAddressTypeHost:
164174
m_value.SetValueType(Value::ValueType::HostAddress);

0 commit comments

Comments
 (0)