[Issue 22095] Closure not created or corrupted when accessing pointer in inline function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 1 21:53:01 UTC 2021


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

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to kinke from comment #2)
> Exactly, but that's to be expected, as it's not captured. The problem is
> rather that this isn't caught when making everything @safe with -dip1000 -
> the compiler should complain that the address of local `s` is assigned to a
> heap closure `pS` with longer lifetime.

Not sure what you mean by this. s and pS should both be in the closure. As far
as I can see, the code is valid even with @safe/-dip1000, and no warning should
be emitted.

--


More information about the Digitalmars-d-bugs mailing list