[Issue 4252] New: [CTFE]: No array bounds checking in assignment to char[] array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 30 08:05:03 PDT 2010


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

           Summary: [CTFE]: No array bounds checking in assignment to
                    char[] array
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2010-05-30 08:05:01 PDT ---
This code shouldn't compile, due to the array bounds error. But instead,
compiler memory corruption occurs.

int bug4252()
{
    char [] s = "abc".dup;
    s[5] = 'd';
    return 3;
}
static assert(bug4252());

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


More information about the Digitalmars-d-bugs mailing list