www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5534] New: [64-bit] Inexplicable segfault in small code snippet, -O -release -m64 only

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5534

           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
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5534


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com
           Platform|Other                       |x86_64



14:59:22 PST ---
Please mark 64 bit only problems with the "x86_64" platform.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5534


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



22:14:27 PST ---
https://github.com/D-Programming-Language/dmd/commit/cd72c8894837a5cfc5be71c62a5e64328afd7d55

https://github.com/D-Programming-Language/dmd/commit/d5e8aea1e3113663227a2158a6f83e30858b08c0

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2011