D Article: Memory Safety
Jakob Ovrum via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Thu Jan 21 05:42:13 PST 2016
On Thursday, 21 January 2016 at 13:39:48 UTC, Dicebot wrote:
> I'd suggest at the very least to add a comment before
> "p.bar();" saying "Must not escape 'p' pointer or @safe-ty will
> be compromised".
I thought about this case, but it relies on UFCS which is
controlled by the callee. The caller can't inject that call if
the callee is careful with its imports.
For member functions, the this reference is `ref` and its address
cannot be taken in @safe code.
More information about the Digitalmars-d-announce
mailing list