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: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@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: -------

Reply via email to