Bug 11134 – Inconsistent postblit call count depends on the pointer size
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-27T22:08:00Z
Last change time
2013-10-08T01:45:21Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-09-27T22:08:52Z
Following code prints different result in 32/64 bit code in Windows.
import core.stdc.stdio : printf;
struct S
{
this(this) { printf("postblit this = %p\n", &this); }
}
void main()
{
S s;
S[2] sa;
S[2][] dsa = [[S(), S()]];
{
printf("---\n");
dsa ~= sa; // [1]
printf("---\n");
dsa ~= [s, s]; // [2]
}
}
$ dmd -m32 run test.d
---
postblit this = 00431FE2
postblit this = 00431FE3
---
postblit this = 0018FE24
postblit this = 0018FE25
postblit this = 00431FE4
postblit this = 00431FE5
$ dmd -m64 run test.d
---
postblit this = 0000000001ED1FE2
---
postblit this = 000000000027F618
postblit this = 000000000027F619
postblit this = 0000000001ED1FE4
Both [1] and [2] should call postblit twice, regardless the pointer size.