www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10637] New: minimallyInitializedArray: postblit on non-initialized...

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

           Summary: minimallyInitializedArray: postblit on
                    non-initialized...
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra gmail.com 2013-07-14 02:44:54 PDT ---
...which can trigger faults in destructor.

No construction should occur at all in minimallyInitializedArray anyways.

//----
    static struct S
    {
        static struct I{int i; alias i this;}
        int* p;
        this()  disable;
        this(int i)
        {
            p = &(new I(i)).i;
        }
        this(this)
        {
            p = &(new I(*p)).i; //HERE
        }
        ~this()
        {
            assert(p != null); //THERE
        }
    }
    auto a = minimallyInitializedArray!(S[])(1);
//----

The above should work. It currently cores at HERE. Skipping HERE makes it
assert at THERE.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 14 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10637


monarchdodra gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|nobody puremagic.com        |monarchdodra gmail.com


--- Comment #1 from monarchdodra gmail.com 2013-07-14 03:45:43 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1413

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 14 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10637


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-10-23
17:19:10 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1498

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