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:
Slava Pestov
2015-08-18 18:52:48 +00:00
parent 880f06aedf
commit ab70e9b554

View File

@@ -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)