changeset 1331:1565b33a6ecb

Fixed CTFE evaluation on .dup . Fixes ticket #288 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sun, 10 May 2009 14:32:23 +0200
parents 459b6b6f9a8d
children de7fad0ad243
files dmd/interpret.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/interpret.c	Sun May 10 04:37:03 2009 +0200
+++ b/dmd/interpret.c	Sun May 10 14:32:23 2009 +0200
@@ -1942,6 +1942,13 @@
 	    if (fd->ident == Id::adDup && arguments && arguments->dim == 2)
 	    {
 		e = (Expression *)arguments->data[1];
+#if IN_LLVM
+                // in LDC we repaint the array argument to void[], skip past that
+                // or CTFE will fail!
+                assert(e->op == TOKcast);
+                CastExp* ce = (CastExp*)e;
+                e = ce->e1;
+#endif
 		e = e->interpret(istate);
 		if (e != EXP_CANT_INTERPRET)
 		{