← Back to index
|
Original Bugzilla link
Bug 15193 – DIP25 (implementation): Lifetimes of temporaries tracked incorrectly
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-12T10:47:00Z
Last change time
2016-10-01T11:48:09Z
Keywords
pull, safe
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0
by timon.gehr — 2015-10-12T10:47:56Z
The following code corrupts memory. enum N=100; ref int[N] foo()@safe{ struct S{ int[N] x; ref int[N] bar()return{ return x; } } return S().bar(); } ref int[N] baz()@safe{ return foo(); } void bang(ref int[N] x)@safe{ x[]=0x25BAD; } void main()@safe{ bang(baz()); } (Contrast this with: ref int foo()@safe{ struct S{ int x; ref int bar()return{ return x; } } S s; return s.bar(); } This is rejected correctly.)
Comment #1
by bugzilla — 2016-07-01T07:34:40Z
https://github.com/dlang/dmd/pull/5895
Comment #2
by github-bugzilla — 2016-07-01T15:51:02Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/f2c50d0ba2fdff00bc58fa6be732e405f2ddf600
fix Issue 15193 - DIP25 (implementation): Lifetimes of temporaries tracked incorrectly
https://github.com/dlang/dmd/commit/2b297099a0d8acb241a1032b7783628914d4c5c2
Merge pull request #5895 from WalterBright/fix15193 fix Issue 15193 - DIP25 (implementation): Lifetimes of temporaries tracked incorrectly
Comment #3
by github-bugzilla — 2016-10-01T11:48:09Z
Commits pushed to stable at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/f2c50d0ba2fdff00bc58fa6be732e405f2ddf600
fix Issue 15193 - DIP25 (implementation): Lifetimes of temporaries tracked incorrectly
https://github.com/dlang/dmd/commit/2b297099a0d8acb241a1032b7783628914d4c5c2
Merge pull request #5895 from WalterBright/fix15193