changeset 634:0084d2c76b74

Fixed problem with taking the delegate of a nested function of the current function.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 02 Oct 2008 01:28:33 +0200
parents d208fc4291df
children ce95d269bf5a
files gen/toir.cpp
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 {