Bug 17725 – [scope] escape from nested function to enclosing local

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-08-06T22:37:05Z
Last change time
2017-10-16T09:57:38Z
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2017-08-06T22:37:05Z
From Rainer: void test() @safe { int* p; struct T { int a; } void escape(ref T t) @safe { p = &t.a; // should not compile } { T t; escape(t); } auto bug = *p; } Compile with -dip1000
Comment #1 by bugzilla — 2017-09-09T09:22:13Z
Comment #2 by github-bugzilla — 2017-09-11T16:59:42Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/6189954a3ecf4d854b64bfb9875eba9a32e00e37 fix Issue 17725 - [scope] escape from nested function to enclosing local https://github.com/dlang/dmd/commit/e201d830f51bd406c2a10617ef9f56dfeeda7725 Merge pull request #7129 from WalterBright/fix17725 fix Issue 17725 - [scope] escape from nested function to enclosing local
Comment #3 by github-bugzilla — 2017-10-16T09:57:38Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/6189954a3ecf4d854b64bfb9875eba9a32e00e37 fix Issue 17725 - [scope] escape from nested function to enclosing local https://github.com/dlang/dmd/commit/e201d830f51bd406c2a10617ef9f56dfeeda7725 Merge pull request #7129 from WalterBright/fix17725