https://issues.dlang.org/show_bug.cgi?id=24694
Issue ID: 24694
Summary: [DIP1000] can escape stack pointer through
struct.class.field
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: safe
Severity: normal
Priority: P3
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This @safe function returns a dangling stack pointer:
```D
class C
{
int* p;
}
struct S
{
C c;
}
int* escape() @safe
{
int x = 0;
S b = S(new C());
b.c.p = &x;
return b.c.p;
}
```
--
