www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4739] New: Bad result retrieving 'char' keys in assoc array

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

           Summary: Bad result retrieving 'char' keys in assoc array
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: cbkbbejeap mailinator.com


--- Comment #0 from Nick Sabalausky <cbkbbejeap mailinator.com> 2010-08-27
00:21:53 PDT ---
import std.stdio;

void main()
{
    auto aa = ['a':1, 'b':2, 'c':3];

    assert('a' in aa); // Ok
    assert('b' in aa); // Ok
    assert('c' in aa); // Ok

    // Expected:
    //   'a', 'b' and 'c' in any order
    // Actual:
    //   'a', '\0' and '\0'
    foreach(char ch; aa.keys)
        write(ch);
}

In my full program (ie, not this simplified test case), the first key is 'a'
(which is ok), the second is 'L' (should be 'b' or 'c'), and the third varies
depending on seemingly trivial and unrelated changes elsewhere. This would seem
to suggest a corrupted pointer somewhere, or maybe memory stomping.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4739


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Steven Schveighoffer <schveiguy yahoo.com> 2010-08-27
07:23:12 PDT ---
*** This issue has been marked as a duplicate of issue 4201 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2010