Bug 7632 – [64bit] byValue() for associative arrays doesn't return the correct values

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-03-02T17:50:00Z
Last change time
2012-11-14T02:46:21Z
Keywords
wrong-code
Assigned to
nobody
Creator
exetoc

Comments

Comment #0 by exetoc — 2012-03-02T17:50:14Z
This has been tested using the latest git revision. Test case: import std.stdio; void main() { int[int] i; foreach (idx; 0 .. 10) i[idx] = idx * 2; writeln(i.byValue()); // output: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] writeln(i.values); // output: [0, 8, 16, 2, 10, 18, 4, 12, 6, 14] }
Comment #1 by hsteoh — 2012-03-13T22:18:01Z
Appears to have been fixed in even more latest git ;-) (2012-03-13). Please verify.
Comment #2 by exetoc — 2012-03-14T17:38:07Z
(In reply to comment #1) > Appears to have been fixed in even more latest git ;-) (2012-03-13). Please > verify. The output is still the same for me.
Comment #3 by hsteoh — 2012-03-14T21:52:47Z
OK I'll leave this bug open for now. I just tried it again with the latest dmd from git, and got this output: [0, 8, 16, 2, 10, 18, 4, 12, 6, 14] [0, 8, 16, 2, 10, 18, 4, 12, 6, 14] I'm also using the latest druntime & phobos from git; I wonder if the problem is caused by a bug in older druntime or phobos. Have you tried building druntime/phobos from git to see if it still has the same effect? P.S. I'm also using 64-bit Linux, so unless there's some system-dependent issue here, I'm quite surprised that we're getting different results.
Comment #4 by exetoc — 2012-03-15T04:20:07Z
(In reply to comment #3) > OK I'll leave this bug open for now. I just tried it again with the latest dmd > from git, and got this output: > > [0, 8, 16, 2, 10, 18, 4, 12, 6, 14] > [0, 8, 16, 2, 10, 18, 4, 12, 6, 14] > > I'm also using the latest druntime & phobos from git; I wonder if the problem > is caused by a bug in older druntime or phobos. Have you tried building > druntime/phobos from git to see if it still has the same effect? > > P.S. I'm also using 64-bit Linux, so unless there's some system-dependent issue > here, I'm quite surprised that we're getting different results. The package installs the latest phobos and druntime as well. I've been checking the modification dates of all the files to make sure that they've been replaced with the newer ones, and I've even tried to remove everything first, before building the sources again, but the output remains the same.
Comment #5 by lovelydear — 2012-04-21T06:13:30Z
Works on 2.059
Comment #6 by exetoc — 2012-04-21T07:51:45Z
(In reply to comment #5) > Works on 2.059 Still doesn't work for me for some reason.
Comment #7 by exetoc — 2012-04-21T08:17:23Z
Are you by any chance using -m32, or something? Because this bug has been confirmed by a 64-bit FreeBSD user, using the 2.059 release, as well as the latest git revision.
Comment #8 by lovelydear — 2012-04-21T12:10:36Z
Oh, I should have precised I'm using the Win32 release. I normally do it, but I forgot. Apologies.
Comment #9 by hsteoh — 2012-10-27T10:55:01Z
You are right, with -m32 it works, but with -m64 it shows the wrong values.
Comment #10 by hsteoh — 2012-10-27T10:55:35Z
P.S. This is on Linux 64-bit (Debian).
Comment #11 by clugdbug — 2012-11-14T02:36:19Z
Still valid. Marked as a 64bit wrong-code bug, raised severity.
Comment #12 by clugdbug — 2012-11-14T02:46:21Z
Marking as a duplicate of bug 8583, which is a better bug report. *** This issue has been marked as a duplicate of issue 8583 ***