Bug 6234 – 64-bit array append generates inline code to copy new data, but does not call postblit

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2011-07-01T05:38:00Z
Last change time
2011-07-05T10:49:03Z
Keywords
patch, wrong-code
Assigned to
nobody
Creator
schveiguy

Comments

Comment #0 by schveiguy — 2011-07-01T05:38:11Z
The 64-bit compiler no longer calls _d_arrayappendT directly, it now calls _d_arrayappendCTX, which does *not* copy the new data to the array. This is fine, because the compiler generates the necessary code to copy the new data. However, the compiler does *not* call postblit on that data. Two ways to fix this: 1. Simply switch to calling _d_arrayappendT again, and don't do the copying inline. 2. Insert a call to __doPostblit (or whatever you want to rename it, it's in rt/lifetime.d) after copying the data, but only if the type *has* a valid postblit. This is the reason the runtime is currently failing unit tests on 64-bit code.
Comment #1 by braddr — 2011-07-01T09:16:20Z
Raising to a blocker, the next release shouldn't ship with this still broken.
Comment #2 by yebblies — 2011-07-04T07:18:31Z
(In reply to comment #1) > Raising to a blocker, the next release shouldn't ship with this still broken. I have a fix for this, but I don't have a 64 bit platform to test it on. Can anybody run it through the test suite on x86-64 for me? https://github.com/yebblies/dmd/tree/issue6234
Comment #3 by bugzilla — 2011-07-05T10:49:03Z
Added yebblie's fix as https://github.com/D-Programming-Language/dmd/commit/3a872937f714214d79c987c2ebef068c0a29285e Needed to add code to account for side effects.