[Issue 21565] @safe code allows modification of a scalar that overlaps with a pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 20 19:43:43 UTC 2021


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

ag0aep6g <ag0aep6g at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ag0aep6g at gmail.com

--- Comment #1 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to Steven Schveighoffer from comment #0)
> Such access should be considered illegal as it does not fit into any of the
> categories. 1, 2, 4, 5, and 6 trivially do not apply. Whether int * is
> considered a "basic type" is possibly open to interpretation, but I would
> say it is not, considering that if it were, then rule 2 would allow
> arbitrary pointer usage. This disqualifies 3, or at least suggests an edit
> is in order.

Just clarifying one little thing:

`int*` is definitely not a "basic data type". As a pointer, it's a "derived
data type". Definitions are here: <https://dlang.org/spec/type.html>.

--


More information about the Digitalmars-d-bugs mailing list