[Issue 19965] [DIP1000] Template allows to escape internal pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 22 13:54:21 UTC 2019


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

Mike Franklin <slavo5150 at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slavo5150 at yahoo.com

--- Comment #1 from Mike Franklin <slavo5150 at yahoo.com> ---
If narrowed this issue down to this line in the DMD source code: 
https://github.com/dlang/dmd/blob/0459e34e20a0631a021550431dfe2411ebe16d3f/src/dmd/escape.d#L1465

When `Foo` is a template, `tf.isscope` is `true`, but when `Foo` is not a
template `tf.isscope` is `false`.

`isscope` is set to *true` at
https://github.com/dlang/dmd/blob/0459e34e20a0631a021550431dfe2411ebe16d3f/src/dmd/semantic3.d#L1316

It is set to *true` because `funcdecl.vthis.storage_class` is `STC.maybescope`.

That's as far as I got.

--


More information about the Digitalmars-d-bugs mailing list