Bug 1313 – out/body disables escape analysis

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2007-07-04T07:22:00Z
Last change time
2015-06-09T05:11:42Z
Keywords
accepts-invalid, patch
Assigned to
nobody
Creator
schaouette

Comments

Comment #0 by schaouette — 2007-07-04T07:22:40Z
This doesn't compile, and this is _normal_ (Error: escaping reference to local a): int[] test() { int a[2]; return a; } But this does compile (DMD 1.01) and should obviously not! int[] test() out{} body { int a[2]; return a; } The problem seems to come from the out section. Removing it raises the compile time error "Error: escaping reference to local a". Regards -- Gilles
Comment #1 by k.hara.pg — 2012-01-12T20:26:32Z
2.058head has same problem, so this is D1 & D2 issue. D2 patch: https://github.com/D-Programming-Language/dmd/pull/617
Comment #2 by k.hara.pg — 2012-01-12T20:29:56Z
*** Issue 7272 has been marked as a duplicate of this issue. ***
Comment #3 by bugzilla — 2012-01-13T10:41:57Z