[Issue 6726] New: DMD crash with index in foreach statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 24 16:46:36 PDT 2011


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

           Summary: DMD crash with index in foreach statement
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-09-24 16:46:02 PDT ---
Heavily reduced test-case (so the snippet might not make sense), originally
from CairoD:

struct ItemRange
{
    @property int front() { return 0; }
}

void main()
{
    ItemRange range;
    foreach (index, element; range)
    {
    }    
}

---------------------------
dmd.exe - Application Error
---------------------------
The instruction at "0x0045b065" referenced memory at "0x00000010". The memory
could not be "read".


Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK   Cancel   
---------------------------

Using DMD 2.055 on XP32. 
Removing index from foreach prevents the crash:

foreach (element; range) { }

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