Bug 17568 – [scope] addresses to fields can be escaped from scope method

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-28T14:32:26Z
Last change time
2017-10-16T09:57:14Z
Keywords
safe
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2017-06-28T14:32:26Z
cat > bug.d << CODE int* p; struct T { int a; void escape() @safe scope { p = &a; } } void escape() @safe { { T t; t.escape; } auto bug = *p; } CODE dmd -c -dip1000 bug ---- Tested with v2.075.0-b1
Comment #1 by bugzilla — 2017-07-25T20:48:01Z
Comment #2 by github-bugzilla — 2017-08-24T13:54:26Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2cd4d61e6a15de1ec5af4df9caf1b4a9a7a33cd7 fix Issue 17568 - [scope] addresses to fields can be escaped from scope method https://github.com/dlang/dmd/commit/d4cbb05d03f9d507833ce3c72e8b017a995e1069 Merge pull request #7022 from WalterBright/fix17568 fix Issue 17568 - [scope] addresses to fields can be escaped from sco… merged-on-behalf-of: Martin Nowak <[email protected]>
Comment #3 by github-bugzilla — 2017-10-16T09:57:14Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2cd4d61e6a15de1ec5af4df9caf1b4a9a7a33cd7 fix Issue 17568 - [scope] addresses to fields can be escaped from scope method https://github.com/dlang/dmd/commit/d4cbb05d03f9d507833ce3c72e8b017a995e1069 Merge pull request #7022 from WalterBright/fix17568