File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1442,7 +1442,8 @@ static void swift_continuation_awaitImpl(ContinuationAsyncContext *context) {
14421442 //
14431443 // This condition variable can be allocated on the stack of the blocking
14441444 // thread - with the address of it published to the resuming thread via the
1445- // context.
1445+ // context. We do this in a new scope.
1446+ do {
14461447 ConditionVariable Cond;
14471448
14481449 context->Cond = &Cond;
@@ -1495,7 +1496,10 @@ static void swift_continuation_awaitImpl(ContinuationAsyncContext *context) {
14951496
14961497#if SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL
14971498 // Since the condition variable is stack allocated, we don't need to do
1498- // anything here to clean up
1499+ // anything here to clean up. But we do have to end the scope that we
1500+ // created the condition variable in so that it'll be destroyed before
1501+ // we try to tail-call.
1502+ } while (false );
14991503#else
15001504 // Restore the running state of the task and resume it.
15011505 task->flagAsRunning ();
You can’t perform that action at this time.
0 commit comments