# HG changeset patch # User Tomas Lindquist Olsen # Date 1222903713 -7200 # Node ID 0084d2c76b7433e237b2b91d21492040eba6ca94 # Parent d208fc4291df8ee693704c0b80f521bd65d8d1e9 Fixed problem with taking the delegate of a nested function of the current function. diff -r d208fc4291df -r 0084d2c76b74 gen/toir.cpp --- a/gen/toir.cpp Wed Oct 01 23:17:36 2008 +0200 +++ b/gen/toir.cpp Thu Oct 02 01:28:33 2008 +0200 @@ -1863,12 +1863,8 @@ DValue* u = e1->toElem(p); LLValue* uval; if (DFuncValue* f = u->isFunc()) { - assert(f->func); - LLValue* contextptr; - if (p->func()->decl == f->func) - contextptr = p->func()->thisArg; - else - contextptr = DtoNestedContext(loc, f->func); + assert(f->func); + LLValue* contextptr = DtoNestedContext(loc, f->func); uval = DtoBitCast(contextptr, getVoidPtrType()); } else {