Bug 13652 – 2D Static Array Init produces wrong result (-m64/-m32)

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P5
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-25T14:00:00Z
Last change time
2015-09-04T08:40:58Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
shammah.chancellor

Attachments

IDFilenameSummaryContent-TypeSize
1448test.dTest casetext/plain509

Comments

Comment #0 by shammah.chancellor — 2014-10-25T14:00:04Z
Created attachment 1448 Test case The attached code produces an array which is initialized improperly when compiled with: dmd64 -m32 test.d or dmd32 -m64 test.d
Comment #1 by bearophile_hugs — 2014-10-25T14:36:17Z
This seems a reduced test case: void main() { uint[9][5] arr = [ [0, 0, 0, 0, 1, 5, 8, 0, 7], [0, 3, 8, 0, 2, 0, 0, 6, 0], [0, 0, 7, 0, 6, 8, 9, 4, 0], [0, 0, 0, 0, 0, 1, 2, 9, 0], [9, 7, 0, 0, 0, 0, 0, 8, 3]]; import std.stdio: writeln; arr.writeln; }
Comment #2 by k.hara.pg — 2015-09-04T07:01:28Z
Comment #3 by github-bugzilla — 2015-09-04T08:40:57Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/83372faf1b925d94fe68bd3b9c31abb346bb2e6b fix Issue 13652 - 2D Static Array Init produces wrong result (-m64/-m32) https://github.com/D-Programming-Language/dmd/commit/30c67419c0b646c13b5a511b80c22b1d579e1793 Merge pull request #5034 from 9rnsr/fix13652 Issue 13652 - 2D Static Array Init produces wrong result (-m64/-m32)