From ad248c217b2356438a1b87daa5fff42e4c06874c Mon Sep 17 00:00:00 2001 From: k-hara Date: Wed, 17 Jul 2013 13:26:29 +0900 Subject: [PATCH] fix small bug introduced by #1660 If `ti->semanticTiargs(sc)` returns false, CallExp should return ErrorExp. --- src/expression.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/expression.c b/src/expression.c index 8d5873982cc5..2adfa5801398 100644 --- a/src/expression.c +++ b/src/expression.c @@ -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 */ @@ -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 */