why static array can be reassigned with new allocation?

Nick Treleaven nick at geany.org
Sat Oct 15 11:45:00 UTC 2022


On Friday, 14 October 2022 at 18:57:44 UTC, mw wrote:

> $ dmd static_array.d
> $ ./static_array
> [0, 0, 0]
> core.exception.RangeError at static_array.d(6): Range violation
> ----------------
> ??:? _d_arrayboundsp [0x55e4830afcb5]
> ??:? _Dmain [0x55e48308f957]
>
>
> $ ldc2 static_array.d
> $ ./static_array
> [0, 0, 0]
> Illegal instruction (core dumped)

Looks like an LDC bug.


More information about the Digitalmars-d mailing list