From 90621b76802f4c12bf3a91befae06845d5b1ceeb Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 22 Apr 2011 18:51:37 +0200 Subject: [PATCH] Merged DMD commit 2c48538ffe1a7ec3abf101799aac12f3b172c081: bugzilla 5238 PATCH: fix return of uninitialised var in interpret.c --- dmd/interpret.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dmd/interpret.c b/dmd/interpret.c index d0cb6cd7..0db2c72e 100644 --- a/dmd/interpret.c +++ b/dmd/interpret.c @@ -1334,6 +1334,11 @@ Expression *DeclarationExp::interpret(InterState *istate) e = ie->exp->interpret(istate); else if (v->init->isVoidInitializer()) e = NULL; + else + { + error("Declaration %s is not yet implemented in CTFE", toChars()); + e = EXP_CANT_INTERPRET; + } } #if DMDV2 else if (s == v && (v->isConst() || v->isImmutable()) && v->init) @@ -1346,13 +1351,19 @@ Expression *DeclarationExp::interpret(InterState *istate) else if (!e->type) e->type = v->type; } + else if (s->isTupleDeclaration() && !v->init) + e = NULL; + else + { + error("Declaration %s is not yet implemented in CTFE", toChars()); + e = EXP_CANT_INTERPRET; + } } else if (declaration->isAttribDeclaration() || declaration->isTemplateMixin() || declaration->isTupleDeclaration()) { // These can be made to work, too lazy now - error("Declaration %s is not yet implemented in CTFE", toChars()); - + error("Declaration %s is not yet implemented in CTFE", toChars()); e = EXP_CANT_INTERPRET; } else