[Issue 8583] New: AA ushort[dchar] byValue range is corrupted on x86_64

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 24 14:00:27 PDT 2012


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

           Summary: AA ushort[dchar] byValue range is corrupted on x86_64
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dmitry.olsh at gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-08-24 14:00:21 PDT ---
The following sample outlines the problem:

void main(){
    ushort[dchar] simpleIndices = ['A':437];
    assert(simpleIndices['A'] == 437);
    assert(simpleIndices.byKey.front == 'A');
    assert(simpleIndices.byValue.front == 437); // this fails on x64
    //assert(simpleIndices.byValue.front == 0); //and this passes on x64 WTF??!
}

compiled with -m32 it passes
with -m64 it fails and instead the value is 0. 
Looking through my corrupted data in the wild I assume it may as well be
something else then 0 too. 

Tested both with latest git and vanila 2.060 on OS Linux x64 & Win32.

There is a workaround of using .values which does allocate an array of values.
Still I consider it critical as corrupted value bug is usually hard to spot and
narrow down.

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