summaryrefslogtreecommitdiff
path: root/tools/linguist/shared/profileevaluator.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-05-14 14:30:08 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-20 14:30:34 +0200
commited3dbbab45125ea74daa31d5c08411d3e5dac03b (patch)
treeb3122b5675f34bf493cee0048b41dbf3e0f7ac83 /tools/linguist/shared/profileevaluator.cpp
parenta76c1d097f14e93517f27debde806da4fd7498b9 (diff)
downloadqt4-tools-ed3dbbab45125ea74daa31d5c08411d3e5dac03b.tar.gz
fix m_invertNext effect scoping
an evaluation function can be an include statement. the included code must neither inherit nor change the current inversion state. cherry-picked 68b1b828e6030b4fe26ca9ffc4ee7a0b4bfe8f4e from creator
Diffstat (limited to 'tools/linguist/shared/profileevaluator.cpp')
-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 d4c4df8b55..95f3b1a966 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;
}