[Issue 15075] New: wrong code with vector assignment of static struct elements

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Sep 16 16:20:22 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15075

          Issue ID: 15075
           Summary: wrong code with vector assignment of static struct
                    elements
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ag0aep6g at gmail.com

This fails depending on T:

----
alias T = long;
void main()
{
    T[2] a1 = [1, 2];
    T[2][1] a2;
    a2[] = a1; /* line 6 */
    assert(a2[0] == a1); /* line 7 */
}
----

If T is long or double, it segfaults on line 6.
If T is ulong, the assert on line 7 fails.
It works with (u)byte, (u)short, (u)int, float, and real.

The problem seems to be with 8 byte wide types.

Tested with git head, 2.067, and 2.068.

--


More information about the Digitalmars-d-bugs mailing list