Fixes for closures

This commit is contained in:
Alexey Prokhin
2010-12-15 17:05:16 +03:00
parent 73c851762b
commit 71f653f19b
7 changed files with 62 additions and 12 deletions

View File

@@ -772,6 +772,9 @@ void DtoDefineFunction(FuncDeclaration* fd)
}
#endif
FuncGen fg;
irfunction->gen = &fg;
DtoCreateNestedContext(fd);
#if DMDV2
@@ -801,12 +804,8 @@ void DtoDefineFunction(FuncDeclaration* fd)
}
// output function body
{
FuncGen fg;
irfunction->gen = &fg;
fd->fbody->toIR(gIR);
irfunction->gen = 0;
}
fd->fbody->toIR(gIR);
irfunction->gen = 0;
// TODO: clean up this mess