[Issue 1914] Array initialisation from const array yeilds memory trample

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 20 18:42:32 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1914


smjg at iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com
           Keywords|                            |wrong-code




------- Comment #4 from smjg at iname.com  2008-11-20 20:42 -------
It seems that it's simply failing to initialise y correctly.  Changing main to

void main()
{
    S1    s;
    writefln(s.y);
    writefln(s.a);

    s.y = 4;
    writefln(s.y);
    writefln(s.a);
}

gives the output

0
[0,1,2,3,4,5,6,7,8,9]
4
[0,1,2,3,4,5,6,7,8,9]


-- 



More information about the Digitalmars-d-bugs mailing list