Skip to content

Commit

Permalink
Merge pull request #1870 from donc/ice9445ctfe
Browse files Browse the repository at this point in the history
9445 ICE(interpret.c) calling parameter in CTFE
  • Loading branch information
yebblies committed Apr 8, 2013
2 parents cb97780 + b3dc0e5 commit d541081
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interpret.c
Expand Up @@ -3933,7 +3933,7 @@ Expression *CallExp::interpret(InterState *istate, CtfeGoal goal)
Expression * pe = ((PtrExp*)ecall)->e1;
if (pe->op == TOKvar) {
VarDeclaration *vd = ((VarExp *)((PtrExp*)ecall)->e1)->var->isVarDeclaration();
if (vd && vd->getValue() && vd->getValue()->op == TOKsymoff)
if (vd && vd->hasValue() && vd->getValue()->op == TOKsymoff)
fd = ((SymOffExp *)vd->getValue())->var->isFuncDeclaration();
else
{
Expand Down Expand Up @@ -3974,7 +3974,7 @@ Expression *CallExp::interpret(InterState *istate, CtfeGoal goal)
else if (ecall->op == TOKvar)
{
VarDeclaration *vd = ((VarExp *)ecall)->var->isVarDeclaration();
if (vd && vd->getValue())
if (vd && vd->hasValue())
ecall = vd->getValue();
else // Calling a function
fd = ((VarExp *)e1)->var->isFuncDeclaration();
Expand Down
12 changes: 12 additions & 0 deletions test/compilable/interpret3.d
Expand Up @@ -4640,6 +4640,18 @@ void bug7419() {
static assert(x == 3);
}

/**************************************************
9445 ice
**************************************************/

template c9445(T...) { }

void ice9445(void delegate() expr, void function() f2)
{
static assert(!is(typeof(c9445!(f2()))));
static assert(!is(typeof(c9445!(expr()))));
}

/**************************************************
7162 and 4711
**************************************************/
Expand Down

0 comments on commit d541081

Please sign in to comment.