Summary: [64-bit]  Inexplicable segfault in small code snippet,
                    -O -release -m64 only
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2011-02-06 14:23:46 PST ---
The following code segfaults, but only when compiled with -O -release -m64.  If
any of these three options are omitted, it succeeds.  Also, note that it
doesn't throw a RangeError when bounds checking is turned on, so the issue is
not that that the bounds are somehow wrong.

void doStuff(byte start, byte end, uint increment = 1U) {
   auto output = new byte[3];

    size_t count = 0;
    for(byte i = start; i < end; i += increment) {
        output[count++] = i;

void main()  {
    doStuff(0, 3);

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to