diff dmd/mtype.c @ 599:4435f57956e7

Fixed .funcptr property of delegates, no longer uses the infamous DMD rewrites to pointer arithmetic, instead a GEPExp has been introduced.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 15 Sep 2008 02:04:26 +0200
parents e6bcc4d9e5ff
children bc83491463f0
line wrap: on
line diff
--- a/dmd/mtype.c	Sun Sep 14 22:49:19 2008 +0200
+++ b/dmd/mtype.c	Mon Sep 15 02:04:26 2008 +0200
@@ -3174,17 +3174,14 @@
 #endif
     if (ident == Id::ptr)
     {
+    e = new GEPExp(e->loc, e, ident, 0);
 	e->type = tvoidptr;
 	return e;
     }
     else if (ident == Id::funcptr)
     {
-	e = e->addressOf(sc);
-	e->type = tvoidptr;
-	e = new AddExp(e->loc, e, new IntegerExp(PTRSIZE));
-	e->type = tvoidptr;
-	e = new PtrExp(e->loc, e);
-	e->type = next->pointerTo();
+    e = new GEPExp(e->loc, e, ident, 1);
+    e->type = tvoidptr;
 	return e;
     }
     else