SILGen: Avoid crashing for invalid conformances.

Force resolution of value witnesses and check the conformance for validity
before proceeding to witness table emission in SILGen to avoid crashing because
of unexpected errors in the AST.

Resolves rdar://123027739
This commit is contained in:
Allan Shortlidge
2024-03-06 10:04:20 -08:00
parent a312225f17
commit 64dc2e9f33
10 changed files with 47 additions and 19 deletions

View File

@@ -1401,9 +1401,7 @@ ResolveImplicitMemberRequest::evaluate(Evaluator &evaluator,
// FIXME: This should be more fine-grained to avoid having to check
// for a cycle here.
if (!evaluator.hasActiveRequest(ResolveValueWitnessesRequest{conformance})) {
evaluateOrDefault(evaluator,
ResolveValueWitnessesRequest{conformance},
evaluator::SideEffect());
conformance->resolveValueWitnesses();
}
}