diff gen/toir.cpp @ 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 607b6b5819a7
children 2a0bcf7f7b3d
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 {