[Issue 1313] New: out/body disables escape analysis
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jul  4 05:22:41 PDT 2007
    
    
  
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 at digitalmars.com
        ReportedBy: schaouette at 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
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list