fix error() not propagating through if()

if() would simply "downgrade" a fatal error to a false condition, which
is certainly not expected.

Change-Id: Ie9c54f2bddf588856498bf795007b341b7c9363a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from qtbase/b27d4835c2ae0d8767ca914acb72a4bdcea6fc85)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Oswald Buddenhagen
2016-06-29 15:40:17 +02:00
parent fcbaf24181
commit b4ac7f6d2c
3 changed files with 8 additions and 7 deletions

View File

@@ -1750,13 +1750,14 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
return ProStringList();
}
bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &where, int line)
QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditional(
const QString &cond, const QString &where, int line)
{
bool ret = false;
VisitReturn ret = ReturnFalse;
ProFile *pro = m_parser->parsedProBlock(cond, where, line, QMakeParser::TestGrammar);
if (pro->isOk()) {
m_locationStack.push(m_current);
ret = visitProBlock(pro, pro->tokPtr()) == ReturnTrue;
ret = visitProBlock(pro, pro->tokPtr());
m_current = m_locationStack.pop();
}
pro->deref();
@@ -1768,7 +1769,7 @@ void QMakeEvaluator::checkRequirements(const ProStringList &deps)
{
ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS"));
foreach (const ProString &dep, deps)
if (!evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line))
if (evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line) != ReturnTrue)
failed << dep;
}
#endif