diff dmd/codegen/Util.d @ 73:ef02e2e203c2

Updating to dmd2.033
author korDen
date Sat, 28 Aug 2010 19:42:41 +0400
parents f708f0452e81
children 7e0d548de9e6
line wrap: on
line diff
--- a/dmd/codegen/Util.d	Sat Aug 28 16:19:48 2010 +0200
+++ b/dmd/codegen/Util.d	Sat Aug 28 19:42:41 2010 +0400
@@ -1,6 +1,7 @@
 module dmd.codegen.Util;
 
 import dmd.Loc;
+import dmd.Id;
 import dmd.IRState;
 import dmd.Type;
 import dmd.Array;
@@ -351,7 +352,12 @@
     Dsymbol fdparent = fd.toParent2();
 
     //printf("getEthis(thisfd = '%s', fd = '%s', fdparent = '%s')\n", thisfd.toChars(), fd.toChars(), fdparent.toChars());
-    if (fdparent == thisfd)
+    if (fdparent == thisfd ||
+		/* These two are compiler generated functions for the in and out contracts,
+		 * and are called from an overriding function, not just the one they're
+		 * nested inside, so this hack is so they'll pass
+		 */
+		fd.ident == Id.require || fd.ident == Id.ensure)
     {	
 		/* Going down one nesting level, i.e. we're calling
 		 * a nested function from its enclosing function.
@@ -405,6 +411,8 @@
 				ethis.Eoper = OPER.OPframeptr;
 			}
 		}
+		
+		//if (fdparent != thisfd) ethis = el_bin(OPadd, TYnptr, ethis, el_long(TYint, 0x18));
     }
     else
     {