Fixed problem with taking the delegate of a nested function of the current function.

This commit is contained in:
Tomas Lindquist Olsen
2008-10-02 01:28:33 +02:00
parent daf14100ce
commit d0ff4494ac

View File

@@ -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 {