Bug 4201 – associative arrays keys property contains corrupted data for keys property for keys of size < size_t

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-05-17T08:08:00Z
Last change time
2014-02-15T02:44:09Z
Assigned to
sean
Creator
schveiguy

Comments

Comment #0 by schveiguy — 2010-05-17T08:08:49Z
This problem exists on 2.046 and is most likely related to bug 4184 which was solved in 2.046. Note that the bugzilla interface does not allow me to select 2.046. test case: void main() { uint[ushort] aa; aa[1] = 1; aa[2] = 2; aa[3] = 3; aa[4] = 4; aa[5] = 5; writefln("%s", aa.keys); } outputs: 4 0 1 0 5
Comment #1 by schveiguy — 2010-07-06T04:38:40Z
*** Issue 4429 has been marked as a duplicate of this issue. ***
Comment #2 by schveiguy — 2010-07-06T04:39:15Z
From bug 4429, reals also have problems as the key type.
Comment #3 by schveiguy — 2010-08-27T07:23:12Z
*** Issue 4739 has been marked as a duplicate of this issue. ***
Comment #4 by malteskarupke — 2012-10-27T10:32:09Z
This seems fixed in DMD 2.060 The example now prints [4, 1, 5, 2, 3]