www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7068] New: copying array of pointers calls memset instead of memcpy with -d

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7068

           Summary: copying array of pointers calls memset instead of
                    memcpy with -d
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



// 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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 05 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7068


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



I can still reproduce this with 2.062, even without '-d',
but it seems to be fixed in master.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2013