Merged DMD commit 2c48538ffe1a7ec3abf101799aac12f3b172c081:

bugzilla 5238 PATCH: fix return of uninitialised var in interpret.c
This commit is contained in:
David Nadlinger
2011-04-22 18:51:37 +02:00
parent b3f5ad66ad
commit 90621b7680

View File

@@ -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