www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1313] New: out/body disables escape analysis

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1313

           Summary: out/body disables escape analysis
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: schaouette free.fr


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


-- 
Jul 04 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1313


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Platform|x86                         |All
            Version|1.010                       |D1 & D2
         OS/Version|Windows                     |All



2.058head has same problem, so this is D1 & D2 issue.

D2 patch:
https://github.com/D-Programming-Language/dmd/pull/617

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1313


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg gmail.com



*** Issue 7272 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 12 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1313


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



10:41:57 PST ---
https://github.com/D-Programming-Language/dmd/commit/dba22f42fca18ecef744dd14e9ce625cb700b438

https://github.com/D-Programming-Language/dmd/commit/53cba196db7ad7d656cea44c7ad90985baa0ac04

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 13 2012