Skip to content

Commit 98a674b

Browse files
Merge pull request #36518 from aschwaighofer/fix_pushAsyncContext_assert
Fix pushAsyncContext
2 parents 81794c8 + fc91036 commit 98a674b

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)