[Issue 17568] New: [scope] addresses to fields can be escaped from scope method
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Jun 28 07:32:26 PDT 2017
    
    
  
https://issues.dlang.org/show_bug.cgi?id=17568
          Issue ID: 17568
           Summary: [scope] addresses to fields can be escaped from scope
                    method
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu
cat > bug.d << CODE
int* p;
struct T
{
    int a;
    void escape() @safe scope
    {
        p = &a;
    }
}
void escape() @safe
{
    {
        T t;
        t.escape;
    }
    auto bug = *p;
}
CODE
dmd -c -dip1000 bug
----
Tested with v2.075.0-b1
--
    
    
More information about the Digitalmars-d-bugs
mailing list