[Issue 20747] New: @live tracking of non-pointer owners not done

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 19 09:15:42 UTC 2020


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

          Issue ID: 20747
           Summary: @live tracking of non-pointer owners not done
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

As reported by Timon Gehr in the n.g.:

void ignore(int* p){}
void main()@live{
    int x=5;
    auto p=&x;
    x=3; // obsoletes p
    *p=4; // should fail
    ignore(p); // not necessary
}

void ignore(int* p){}
void main()@live{
    int x=5;
    auto p=&x;
    *p=4;
    x=3;   // ok
    ignore(p); // not necessary
}

void main()@live{
    int x=5;
    auto p=&x;
    auto q=&x;  // allow address to be taken multiple times
    *p=4;
    *q=5;
    writeln(*p," ",*q);
    ignore(p);
    ignore(q);
}

--


More information about the Digitalmars-d-bugs mailing list