Bug 7068 – copying array of pointers calls memset instead of memcpy with -d

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-12-05T19:56:00Z
Last change time
2014-08-22T08:04:27Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2011-12-05T19:56:23Z
// REQUIRED_ARGS: -d void main() { auto darray1 = new int*[](10); foreach(ref v; darray1) v = new int; auto darray2 = new int*[](10); darray2[] = darray1[]; // calls memset instead of memcpy foreach(i; 0 .. 10) assert(darray1[i] == darray2[i]); } --- Happens only with '-d' flag.
Comment #1 by code — 2013-04-03T19:43:32Z
I can still reproduce this with 2.062, even without '-d', but it seems to be fixed in master.
Comment #2 by github-bugzilla — 2014-07-12T05:21:01Z
Comment #3 by github-bugzilla — 2014-07-16T03:52:21Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a694824566a027308c3a32c8bf9c9bc7bc9f84ea Merge pull request #3746 from Safety0ff/test7068 Add regression test for bug 7068.
Comment #4 by github-bugzilla — 2014-07-16T09:16:35Z
Comment #5 by github-bugzilla — 2014-08-22T08:04:27Z