-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIruntime-async
Milestone
Description
Observed while enabling rt async in Libraires partition - #119432
This triggers asserts like assert(!layout->HasGCByRef());
in AsyncTransformation::LayOutContinuation
Also see discussion in: #119432 (comment)
The actual reason is not completely known and the assert may be seen when compiling methods like:
public static Task WhenAll(params ReadOnlySpan<Task> tasks)
{
switch (tasks.Length)
{
case 0:
return CompletedTask;
case 1:
Task t = tasks[0];
if (t is null)
{
ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_NullTask, ExceptionArgument.tasks);
}
return t;
default:
return new WhenAllPromise(tasks);
}
}
The method itself is not async, but we generate an async thunk for it, which has the same ref-like parameter.
The thunk is simply passes the parameter to the wrapped call and does not use the parameter after the call (that is true for all parameters) and therefore nothing ref-like, or perhaps nothing at all, should need capturing into a closure.
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIruntime-async