From d0ff4494acffabb90137d2b607c3482322dae1c8 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Thu, 2 Oct 2008 01:28:33 +0200 Subject: [PATCH] Fixed problem with taking the delegate of a nested function of the current function. --- gen/toir.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index d6247a0d..46b182a2 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1863,12 +1863,8 @@ DValue* DelegateExp::toElem(IRState* p) 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 {