[IRGen] Metadata for the conforming type in a witness table access need not be complete.

When calling a witness table accessor, IRGen was forcing the
conforming type to have complete metadata, even though only abstract
metadata is required for that query. This could cause cyclic metadata
dependencies when checking conditional conformances.

Fixes SR-5958.
This commit is contained in:
Doug Gregor
2019-02-05 22:02:49 -08:00
parent 87db85fdef
commit 229ddf570f
6 changed files with 47 additions and 14 deletions

View File

@@ -1114,7 +1114,7 @@ static llvm::Value *emitWitnessTableAccessorCall(
// Emit the source metadata if we haven't yet.
if (!*srcMetadataCache) {
*srcMetadataCache = IGF.emitTypeMetadataRef(
*srcMetadataCache = IGF.emitAbstractTypeMetadataRef(
conformance->getType()->getCanonicalType());
}