File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -669,10 +669,12 @@ isAnyObjectExistentialType(const ExistentialTypeMetadata *targetType) {
669
669
if (numProtos != 1 )
670
670
return false ;
671
671
const ProtocolDescriptor *protocol = targetType->Protocols [0 ];
672
+ bool isAnyObjectProtocol =
673
+ protocol->Flags .getSpecialProtocol () == SpecialProtocol::AnyObject;
672
674
// Assert that AnyObject does not need any witness tables. We rely on this.
673
- assert (!protocol->Flags .needsWitnessTable () &&
675
+ assert (!isAnyObjectProtocol || ! protocol->Flags .needsWitnessTable () &&
674
676
" AnyObject should not require witness tables" );
675
- return (protocol-> Flags . getSpecialProtocol () == SpecialProtocol::AnyObject) ;
677
+ return isAnyObjectProtocol ;
676
678
}
677
679
678
680
// / Given a possibly-existential value, find its dynamic type and the
You can’t perform that action at this time.
0 commit comments