https://issues.dlang.org/show_bug.cgi?id=22864
RazvanN <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from RazvanN <[email protected]> --- This is a gluelayer problem (common for all 3 backends). I haven't looked at what gdc and ldc do, but in dmd the gluelayer first inserts a call to _d_arrayliteral (which allocates the array with the gc) and then it calls getS(). Look ma! I even got the code to prove it: https://github.com/dlang/dmd/blob/master/src/dmd/e2ir.d#L4834. I assume that this is what gdc and ldc do also, so it's not a frontend bug. The solution could be to first store the initializers on the stack and memcpy them after we allocate the array (essentially, the else branch of the verion in the original report). --
