Skip to content

Commit

Permalink
Immediately returns ErrorExp if an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jun 8, 2013
1 parent 66996ba commit 61d190b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/expression.c
Expand Up @@ -8740,9 +8740,15 @@ Expression *CallExp::semantic(Scope *sc)
else if (sc->func && !sc->needctfe)
{
if (!tf->purity && !(sc->flags & SCOPEdebug) && sc->func->setImpure())
{
error("pure function '%s' cannot call impure %s '%s'", sc->func->toPrettyChars(), p, e1->toChars());
return new ErrorExp();
}
if (tf->trust <= TRUSTsystem && sc->func->setUnsafe())
{
error("safe function '%s' cannot call system %s '%s'", sc->func->toPrettyChars(), p, e1->toChars());
return new ErrorExp();
}
}

if (t1->ty == Tpointer)
Expand Down

0 comments on commit 61d190b

Please sign in to comment.