mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ASTDumper: Fix crash when printing invalid conformances
As far as I can tell the only way to exercise this code path is with -dump-ast. Swift SVN r31302
This commit is contained in:
@@ -2043,6 +2043,9 @@ ConformanceLookupTable::getSatisfiedProtocolRequirementsForMember(
|
||||
auto &reqs = ConformingDeclMap[member];
|
||||
if (isa<TypeDecl>(member)) {
|
||||
for (auto *conf : result) {
|
||||
if (conf->isInvalid())
|
||||
continue;
|
||||
|
||||
conf->forEachTypeWitness(resolver, [&](const AssociatedTypeDecl *assoc,
|
||||
const Substitution &subst,
|
||||
TypeDecl *typeDecl) -> bool {
|
||||
@@ -2053,6 +2056,9 @@ ConformanceLookupTable::getSatisfiedProtocolRequirementsForMember(
|
||||
}
|
||||
} else {
|
||||
for (auto *conf : result) {
|
||||
if (conf->isInvalid())
|
||||
continue;
|
||||
|
||||
conf->forEachValueWitness(resolver, [&](ValueDecl *req,
|
||||
ConcreteDeclRef witness) {
|
||||
if (witness.getDecl() == member)
|
||||
|
||||
Reference in New Issue
Block a user