comparison dmd/interpret.c @ 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 b30fe7e1dbb9
children 7c6dcb98ac35
comparison
equal deleted inserted replaced
1330:459b6b6f9a8d 1331:1565b33a6ecb
1940 #endif 1940 #endif
1941 // Inline .dup 1941 // Inline .dup
1942 if (fd->ident == Id::adDup && arguments && arguments->dim == 2) 1942 if (fd->ident == Id::adDup && arguments && arguments->dim == 2)
1943 { 1943 {
1944 e = (Expression *)arguments->data[1]; 1944 e = (Expression *)arguments->data[1];
1945 #if IN_LLVM
1946 // in LDC we repaint the array argument to void[], skip past that
1947 // or CTFE will fail!
1948 assert(e->op == TOKcast);
1949 CastExp* ce = (CastExp*)e;
1950 e = ce->e1;
1951 #endif
1945 e = e->interpret(istate); 1952 e = e->interpret(istate);
1946 if (e != EXP_CANT_INTERPRET) 1953 if (e != EXP_CANT_INTERPRET)
1947 { 1954 {
1948 e = expType(type, e); 1955 e = expType(type, e);
1949 } 1956 }