← Back to index
|
Original Bugzilla link
Bug 16589 – Taking address of stack variables in @safe code is allowed in some cases
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-04T10:05:00Z
Last change time
2017-01-07T03:02:09Z
Keywords
accepts-invalid, safe
Assigned to
nobody
Creator
bugzilla
Comments
Comment #0
by bugzilla — 2016-10-04T10:05:54Z
Each of the return statements should all generate an error: struct S { int data; @safe int* access1() { return &data; } @safe S* access2() { return &this; } } @safe int* access3(ref S s) { return &s.data; } @safe S* access4(ref S s) { return &s; } @safe int* access5(S s) { return &s.data; } @safe S* access6(S s) { return &s; }
Comment #1
by bugzilla — 2016-10-04T10:13:36Z
https://github.com/dlang/dmd/pull/6172
Comment #2
by github-bugzilla — 2016-10-07T05:17:36Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/34213361ec3cd13485db7eb4044e93b85178397c
fix Issue 16589 - Taking address of stack variables in @safe code is allowed in some cases
https://github.com/dlang/dmd/commit/c871b7b2efb49933f8b103b775079c8731c98fa8
Merge pull request #6172 from WalterBright/fix16589 fix Issue 16589 - Taking address of stack variables in @safe code is …
Comment #3
by github-bugzilla — 2016-11-04T09:05:19Z
Commits pushed to newCTFE at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/34213361ec3cd13485db7eb4044e93b85178397c
fix Issue 16589 - Taking address of stack variables in @safe code is allowed in some cases
https://github.com/dlang/dmd/commit/c871b7b2efb49933f8b103b775079c8731c98fa8
Merge pull request #6172 from WalterBright/fix16589
Comment #4
by github-bugzilla — 2017-01-07T03:02:09Z
Commits pushed to stable at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/34213361ec3cd13485db7eb4044e93b85178397c
fix Issue 16589 - Taking address of stack variables in @safe code is allowed in some cases
https://github.com/dlang/dmd/commit/c871b7b2efb49933f8b103b775079c8731c98fa8
Merge pull request #6172 from WalterBright/fix16589