[Distributed] Don't crash in thunk generation when missing SR conformance

This commit is contained in:
Konrad `ktoso` Malawski
2023-10-30 19:44:24 +09:00
parent a14075ab31
commit 30653a8091
8 changed files with 88 additions and 15 deletions

View File

@@ -842,9 +842,15 @@ FuncDecl *GetDistributedThunkRequest::evaluate(Evaluator &evaluator,
if (!distributedTarget->isDistributed())
return nullptr;
}
assert(distributedTarget);
// This evaluation type-check by now was already computed and cached;
// We need to check in order to avoid emitting a THUNK for a distributed func
// which had errors; as the thunk then may also cause un-addressable issues and confusion.
if (swift::checkDistributedFunction(distributedTarget)) {
return nullptr;
}
auto &C = distributedTarget->getASTContext();
if (!getConcreteReplacementForProtocolActorSystemType(distributedTarget)) {