summaryrefslogtreecommitdiffstats
path: root/tools/linguist
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist')
-rw-r--r--tools/linguist/shared/profileevaluator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp
index d4c4df8..95f3b1a 100644
--- a/tools/linguist/shared/profileevaluator.cpp
+++ b/tools/linguist/shared/profileevaluator.cpp
@@ -849,6 +849,9 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value)
bool ProFileEvaluator::Private::visitProFunction(ProFunction *func)
{
+ // Make sure that called subblocks don't inherit & destroy the state
+ bool invertThis = m_invertNext;
+ m_invertNext = false;
if (!m_sts.updateCondition || m_sts.condition == ConditionFalse) {
QString text = func->text();
int lparen = text.indexOf(QLatin1Char('('));
@@ -858,10 +861,9 @@ bool ProFileEvaluator::Private::visitProFunction(ProFunction *func)
QString funcName = text.left(lparen);
m_lineNo = func->lineNumber();
bool result = evaluateConditionalFunction(funcName.trimmed(), arguments);
- if (!m_skipLevel && (result ^ m_invertNext))
+ if (!m_skipLevel && (result ^ invertThis))
m_sts.condition = ConditionTrue;
}
- m_invertNext = false;
return true;
}