Bug 20747 – @live tracking of non-pointer owners not done
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-19T09:15:42Z
Last change time
2020-04-27T13:01:30Z
Keywords
live, pull
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2020-04-19T09:15:42Z
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);
}
Comment #1 by dlang-bot — 2020-04-20T08:46:01Z
@WalterBright created dlang/dmd pull request #11048 "fix Issue 20747 - @live tracking of non-pointer owners not done" fixing this issue:
- fix Issue 20747 - @live tracking of non-pointer owners not done
https://github.com/dlang/dmd/pull/11048
Comment #2 by dlang-bot — 2020-04-27T13:01:30Z
dlang/dmd pull request #11048 "fix Issue 20747 - @live tracking of non-pointer owners not done" was merged into master:
- 89609c707b0798f4b4d46d15617fdb54208ba124 by Walter Bright:
fix Issue 20747 - @live tracking of non-pointer owners not done
https://github.com/dlang/dmd/pull/11048