[Issue 8095] [64 bit] Wrong code generation with ref parameters, -m64 -O

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 15 04:39:34 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8095



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-05-15 04:41:04 PDT ---
This is similar to bug 8093.
It occurs in Windows 7 64-bit, and the cause is accessing ref variable in outer
scope from nested function.

int g;
ref int foo() {
   ref int __result;
   Container c;
   switch(c.opApply((ref int n){
       __result = g;   // accessing ref variable from nested function
       return 2;
       return 0;
   })){
       default: break;
       case 2: return __vresult;
   }
   return g;
}

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


More information about the Digitalmars-d-bugs mailing list