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

--- Comment #0 from Nick Sabalausky <> 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)

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:
------- You are receiving this mail because: -------

Reply via email to