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.
Comment #1 by k.hara.pg — 2013-09-27T22:34:18Z
Comment #2 by github-bugzilla — 2013-10-08T01:45:08Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cb8b4c7bc3c461827f1bab6daf6d9ee7ffebe1dd fix Issue 11134 - Inconsistent postblit call count depends on the pointer size Move postblit function call to front-end on CatAssignExp with appending element https://github.com/D-Programming-Language/dmd/commit/dce0d030604c5b6082fccdaa5e0dcc4640e31d6a Merge pull request #2593 from 9rnsr/fix_postblit Issue 11134 - Inconsistent postblit call count depends on the pointer size