Skip to content

Commit fc91036

Browse files
committed
Fix pushAsyncContext
We no longer store arguments in the async context (like the closure context). The assert is no longer true
1 parent 817a005 commit fc91036

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/public/Concurrency/AsyncCall.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ pushAsyncContext(CallerContext *callerContext, size_t calleeContextSize,
153153
Args... args) {
154154
using CalleeContext =
155155
AsyncCalleeContext<CallerContext, CalleeSignature>;
156-
assert(calleeContextSize >= sizeof(CalleeContext));
157156

158157
void *rawCalleeContext = swift_task_alloc(calleeContextSize);
159-
return new (rawCalleeContext) CalleeContext(resumeFunction,
160-
callerContext, args...);
158+
// We no longer store arguments in the context so we can just cast to an async
159+
// context.
160+
return reinterpret_cast<CalleeContext *>(new (rawCalleeContext) AsyncContext(
161+
AsyncContextKind::Ordinary, resumeFunction, callerContext));
161162
}
162163

163164
/// Make an asynchronous call.

0 commit comments

Comments
 (0)