Skip to content

Commit 1e58387

Browse files
committed
[Reflection] Support OpaqueExistential in RecordTypeInfo::readExtraInhabitantIndex
1 parent 843b25b commit 1e58387

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

stdlib/public/Reflection/TypeLowering.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,19 @@ bool RecordTypeInfo::readExtraInhabitantIndex(remote::MemoryReader &reader,
260260
int *extraInhabitantIndex) const {
261261
switch (SubKind) {
262262
case RecordKind::Invalid:
263-
case RecordKind::OpaqueExistential:
264263
case RecordKind::ClosureContext:
265264
return false;
266265

266+
case RecordKind::OpaqueExistential: {
267+
if (Fields.size() != 1) {
268+
return false;
269+
}
270+
auto metadata = Fields[0];
271+
auto metadataFieldAddress = address + metadata.Offset;
272+
return metadata.TI.readExtraInhabitantIndex(
273+
reader, metadataFieldAddress, extraInhabitantIndex);
274+
}
275+
267276
case RecordKind::ThickFunction: {
268277
if (Fields.size() != 2) {
269278
return false;

0 commit comments

Comments
 (0)