Skip to content

Commit 3fe8b80

Browse files
authored
Merge pull request #38318 from mikeash/fix-protocol-conformance-pure-objc-classes
[Runtime] Fix protocol conformance checks on pure ObjC classes.
2 parents 1c71091 + 06ff648 commit 3fe8b80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ static MetadataResponse getSuperclassForMaybeIncompleteMetadata(
175175
// always fully set up, so we can just skip it and fetch the Subclass field.
176176
if (classMetadata->isTypeMetadata() && classMetadata->isArtificialSubclass())
177177
return {classMetadata->Superclass, MetadataState::Complete};
178+
179+
// Pure ObjC classes are already set up, and the code below will not be
180+
// happy with them.
181+
if (!classMetadata->isTypeMetadata())
182+
return {classMetadata->Superclass, MetadataState::Complete};
178183
#endif
179184

180185
MetadataState metadataState;

0 commit comments

Comments
 (0)