Merged DMD commit ba365d098576e39859d02f3dd9eaac7e682c9c7f:

bugzilla 4949 ICE on invalid static if using value of 'this'
This commit is contained in:
David Nadlinger
2011-04-22 15:07:56 +02:00
parent ef30947756
commit e092bd00df

View File

@@ -2706,21 +2706,32 @@ Expression *CallExp::interpret(InterState *istate)
Expression * pe = ((PtrExp*)ecall)->e1;
if (pe->op == TOKvar) {
VarDeclaration *vd = ((VarExp *)((PtrExp*)ecall)->e1)->var->isVarDeclaration();
if (vd && vd->value && vd->value->op==TOKsymoff)
if (vd && vd->value && vd->value->op == TOKsymoff)
fd = ((SymOffExp *)vd->value)->var->isFuncDeclaration();
else {
ecall = vd->value->interpret(istate);
if (ecall->op==TOKsymoff)
if (ecall->op == TOKsymoff)
fd = ((SymOffExp *)ecall)->var->isFuncDeclaration();
}
}
else
ecall = ((PtrExp*)ecall)->e1->interpret(istate);
}
if (ecall == EXP_CANT_INTERPRET)
return ecall;
if (ecall->op == TOKindex)
ecall = e1->interpret(istate);
{ ecall = e1->interpret(istate);
if (ecall == EXP_CANT_INTERPRET)
return ecall;
}
if (ecall->op == TOKdotvar && !((DotVarExp*)ecall)->var->isFuncDeclaration())
ecall = e1->interpret(istate);
{ ecall = e1->interpret(istate);
if (ecall == EXP_CANT_INTERPRET)
return ecall;
}
if (ecall->op == TOKdotvar)
{ // Calling a member function