Skip to content

Commit a5d2a4e

Browse files
committed
AST: Check return value of ProtocolConformance::getTypeWitness()
This method returns an empty Type if the conformance is currently being checked. The other caller of this method in the GenericSignatureBuilder checked the return value and bailed out, but one place did not. This is probably not the right long-term fix, but it matches what the other caller of getTypeWitness() does in this file. I don't have a reduced test case either; the repro involves building a specific revision of the standard library with a patch applied. However, the fix can't really do any harm, since passing an empty Type here quickly crashes. Fixes <rdar://problem/32296747>, <https://bugs.swift.org/browse/SR-4945>.
1 parent 940e0a0 commit a5d2a4e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,7 @@ static void concretizeNestedTypeFromConcreteParent(
17201720
witnessType =
17211721
conformance.getConcrete()
17221722
->getTypeWitness(assocType, builder.getLazyResolver());
1723+
if (!witnessType) return;
17231724
} else {
17241725
witnessType = DependentMemberType::get(concreteParent, assocType);
17251726
}

0 commit comments

Comments
 (0)