[Issue 4621] Destructors are inherently un- at safe

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 29 03:35:30 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=4621

anonymous4 <dfj1esp02 at sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #20 from anonymous4 <dfj1esp02 at sneakemail.com> ---
AFAIK, the freed memory references are nor nullified.
Another example:

class A
{
    @safe:
    int[] a;
    this(){ a=new int[1]; }
    ~this(){ a[0]=0; } //write after free
}

void f() @safe
{
    auto a=new A;
}

--


More information about the Digitalmars-d-bugs mailing list