Closed
Description
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
class Program
{
[StructLayout(LayoutKind.Sequential)]
unsafe struct S
{
fixed byte x[65536];
}
class C
{
public S s;
}
static void Main() => Test(new C());
[MethodImpl(MethodImplOptions.NoInlining)]
static void Call(int r0, int r1, int r2, int r3, int r4, int r5, int r6, S s)
{
}
[MethodImpl(MethodImplOptions.NoInlining)]
static void Test(C c)
{
Call(0, 1, 2, 3, 4, 5, 42, c.s);
Console.WriteLine("done");
}
}
genPutArgStk
is basically doing an unrolled copy and the emitter asserts because the offset is too large. It shouldn't do unroll, even for smaller structs.