[Issue 7245] New: [CTFE] Address of ref foreach parameter changes to point after array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 7 21:37:05 PST 2012


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

           Summary: [CTFE] Address of ref foreach parameter changes to
                    point after array
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis <verylonglogin.reg at gmail.com> 2012-01-08 08:37:03 MSK ---
---
int func() {
    int[2] arr;
    int* ptr;

    foreach(i, ref p; arr) if(i == 0)
        ptr = &p;

    int j = *ptr;
    return 0;
}

enum e = func();
---
Error: array index 2 is out of bounds [0,0][0 .. 2]
Error: CTFE internal error: illegal value __error

Assertion failure: 'isCtfeValueValid(newval)' on line 6369 in file
'interpret.c'

-- 
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