Skip to content

Commit b85f9cd

Browse files
committed
take base class into account when calculating member index
1 parent 93a4ce8 commit b85f9cd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/source/Target/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,11 @@ llvm::Optional<size_t> SwiftLanguageRuntimeImpl::GetIndexOfChildMemberWithName(
12221222
auto tip = LLDBTypeInfoProvider(*this, *ts);
12231223
auto *cti = tc.getClassInstanceTypeInfo(tr, 0, &tip);
12241224
if (auto *rti = llvm::cast_or_null<RecordTypeInfo>(cti)) {
1225-
if (auto size =
1226-
findFieldWithName(rti->getFields(), name, child_indexes))
1225+
uint32_t offset = builder.lookupSuperclass(tr) ? 1 : 0;
1226+
if (auto size = findFieldWithName(rti->getFields(), name, child_indexes,
1227+
offset)) {
12271228
return size;
1229+
}
12281230
// TODO: handle base classes.
12291231
}
12301232
return {};

0 commit comments

Comments
 (0)