← Back to index
|
Original Bugzilla link
Bug 17959 – [DIP1000] Can store scope delegate in non-scope member
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-11-01T17:50:04Z
Last change time
2018-03-12T11:29:14Z
Keywords
safe
Assigned to
No Owner
Creator
Mathias Lang
Comments
Comment #0
by mathias.lang — 2017-11-01T17:50:04Z
The following segfault: ``` class Foo { private void delegate () @safe escape; void esc () @safe scope { this.escape = &this.esc; } } void main () @safe { auto x2 = bar(); assert(x2 !is null); x2(); } void delegate() @safe bar () @safe { scope o = new Foo; o.esc; return o.escape; } ``` I'd except the assignment in esc to fail. Tested with v2.076.1 and f3446967d
Comment #1
by bugzilla — 2018-03-12T00:48:53Z
https://github.com/dlang/dmd/pull/8008
Comment #2
by github-bugzilla — 2018-03-12T11:29:13Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/28879f6379bca25d6b2c984dcb43dc7cce8560f9
fix Issue 17959 - [DIP1000] Can store scope delegate in non-scope member
https://github.com/dlang/dmd/commit/44c37732cbb54236c53e407f2be8e0789ef2346e
Merge pull request #8008 from WalterBright/fix17959 fix Issue 17959 - [DIP1000] Can store scope delegate in non-scope member merged-on-behalf-of: Walter Bright <
[email protected]
>