[Issue 20988] Missing error for negated array.ptr

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 13 17:38:33 UTC 2020


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

hsteoh at quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |hsteoh at quickfur.ath.cx
         Resolution|---                         |INVALID

--- Comment #2 from hsteoh at quickfur.ath.cx ---
There doesn't seem to be a real problem here?  `b` would just be set to true if
arr.ptr is null, and false otherwise.

Accessing the value of a pointer is perfectly fine in @safe. Even deferencing a
pointer is fine, since any pointer value constructed in a @safe manner would
not point to something invalid.  What's not allowed in @safe is *pointer
arithmetic*.

--


More information about the Digitalmars-d-bugs mailing list