Merged DMD commit 0fbeb2af9206600453af6e6a14bafc639b35b95c:

bugzilla 5159 Segfault(interpret.c): calling a static function pointer variable in CTFE
This commit is contained in:
David Nadlinger
2011-04-22 18:32:37 +02:00
parent a632331218
commit 631453d41b

View File

@@ -2711,11 +2711,15 @@ Expression *CallExp::interpret(InterState *istate)
VarDeclaration *vd = ((VarExp *)((PtrExp*)ecall)->e1)->var->isVarDeclaration();
if (vd && vd->value && vd->value->op == TOKsymoff)
fd = ((SymOffExp *)vd->value)->var->isFuncDeclaration();
else {
ecall = vd->value->interpret(istate);
else
{
ecall = getVarExp(loc, istate, vd);
if (ecall == EXP_CANT_INTERPRET)
return ecall;
if (ecall->op == TOKsymoff)
fd = ((SymOffExp *)ecall)->var->isFuncDeclaration();
}
fd = ((SymOffExp *)ecall)->var->isFuncDeclaration();
}
}
else
ecall = ((PtrExp*)ecall)->e1->interpret(istate);