diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 453fe88bd0132b9fb86058e3d1879c8505fd6eb8..8a3b1edfe280e50f109e91173a970c4987d28c08 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -869,6 +869,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('('));
@@ -878,10 +881,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;
 }