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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Nick Sabalausky <[email protected]> 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: -------