Skip to content

Commit

Permalink
fix small bug introduced by #1660
Browse files Browse the repository at this point in the history
If `ti->semanticTiargs(sc)` returns false, CallExp should return ErrorExp.
  • Loading branch information
9rnsr committed Jul 17, 2013
1 parent cc6b737 commit ad248c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/expression.c
Expand Up @@ -8382,8 +8382,9 @@ Expression *CallExp::semantic(Scope *sc)
/* Attempt to instantiate ti. If that works, go with it.
* If not, go with partial explicit specialization.
*/
if (ti->semanticTiargs(sc) &&
ti->needsTypeInference(sc, 1))
if (!ti->semanticTiargs(sc))
return new ErrorExp();
if (ti->needsTypeInference(sc, 1))
{
/* Go with partial explicit specialization
*/
Expand Down Expand Up @@ -8414,9 +8415,10 @@ Expression *CallExp::semantic(Scope *sc)
/* Attempt to instantiate ti. If that works, go with it.
* If not, go with partial explicit specialization.
*/
if (se->findTempDecl(sc) &&
ti->semanticTiargs(sc) &&
ti->needsTypeInference(sc, 1))
if (!se->findTempDecl(sc) ||
!ti->semanticTiargs(sc))
return new ErrorExp();
if (ti->needsTypeInference(sc, 1))
{
/* Go with partial explicit specialization
*/
Expand Down

0 comments on commit ad248c2

Please sign in to comment.