fix return() sanity check

the value map stack always has at least one map on it.

Change-Id: I836de07a14754b995403065443d3758bfc6a8683
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-24 21:52:24 +02:00
parent 12e9472934
commit fddd20ffad

View File

@@ -1091,7 +1091,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
// they cannot be used to terminate loops anyway. // they cannot be used to terminate loops anyway.
if (m_cumulative) if (m_cumulative)
return ReturnTrue; return ReturnTrue;
if (m_valuemapStack.isEmpty()) { if (m_valuemapStack.size() == 1) {
evalError(fL1S("unexpected return().")); evalError(fL1S("unexpected return()."));
return ReturnFalse; return ReturnFalse;
} }