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

           Summary: Able to overwrite immutable data
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: robert.we...@hotmail.com


--- Comment #0 from robert.we...@hotmail.com 2011-01-26 12:52:31 PST ---
Hello, I wrote a simple D program to test the immutable attribute and
discovered that by using standard input I could change immutable data, see code
below.

import std.stdio;

void main() {

    //Initialize string buf
    immutable char[] buf = "hello";
    writefln("buf = %s",buf);

    //Change value of buf with standard input
    stdin.readln(buf);
    writefln("buf = %s",buf);

}

Cheers
Robert

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to