[Issue 20722] typeid(X).initializer() breaks safety

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 6 18:52:00 UTC 2020


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

Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario at gmx.de

--- Comment #1 from Rainer Schuetze <r.sagitario at gmx.de> ---
This is as safe/unsafe as any null pointer:

struct S { int a, b; }
void main() @safe
{
    S* s;
    s.b = 3;
}

null pointer accesses and anything in the vicinity are not considered a safety
problem because they are supposed to cause an access violation, not a memory
corruption.

--


More information about the Digitalmars-d-bugs mailing list