mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Distributed] Don't hang, but throw when target accessor not found
This commit is contained in:
@@ -109,6 +109,11 @@ static void swift_distributed_execute_target_resume(
|
||||
return resumeInParent(parentCtx, error);
|
||||
}
|
||||
|
||||
SWIFT_CC(swift)
|
||||
SWIFT_EXPORT_FROM(swiftDistributed)
|
||||
SwiftError* swift_distributed_makeDistributedTargetAccessorNotFoundError(
|
||||
const char *targetNameStart, size_t targetNameLength);
|
||||
|
||||
SWIFT_CC(swiftasync)
|
||||
void swift_distributed_execute_target(
|
||||
SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
|
||||
@@ -124,8 +129,12 @@ void swift_distributed_execute_target(
|
||||
void **decoderWitnessTable) {
|
||||
auto *accessor = findDistributedAccessor(targetNameStart, targetNameLength);
|
||||
if (!accessor) {
|
||||
assert(false && "no distributed accessor");
|
||||
return; // FIXME(distributed): return -1 here so the lib can fail the call
|
||||
SwiftError *error =
|
||||
swift_distributed_makeDistributedTargetAccessorNotFoundError(targetNameStart, targetNameLength);
|
||||
auto resumeInParent =
|
||||
reinterpret_cast<TargetExecutorSignature::ContinuationType *>(
|
||||
callerContext->ResumeParent);
|
||||
return resumeInParent(callerContext, error);
|
||||
}
|
||||
|
||||
auto *asyncFnPtr = reinterpret_cast<
|
||||
|
||||
Reference in New Issue
Block a user