[Issue 5725] New: ubyte/ushort infinite foreach loops

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 10 05:22:34 PST 2011


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

           Summary: ubyte/ushort infinite foreach loops
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-03-10 05:19:30 PST ---
Problem found by Magnus Lie Hetland.
This program produces two infinite loops, DMD 2.052:


void main() {
    alias ubyte T1;
    T1[T1.max + 1] array1;
    foreach (T1 i, _; array1) {}
    alias ushort T2;
    T2[T2.max + 1] array2;
    foreach (T2 i, _; array2) {}
}

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