From a4e4c44ac2552521b2bac2bc02adcb2f918b0205 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 8 Feb 2010 16:51:50 +0100
Subject: [PATCH] re-entrancy: $$list() counter cannot be static

---
 src/shared/proparser/profileevaluator.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 970622c3d19..9f80d941150 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -296,6 +296,7 @@ public:
     QHash<const ProFile*, QHash<QString, QStringList> > m_filevaluemap; // Variables per include file
     QString m_outputDir;
 
+    int m_listCount;
     bool m_definingTest;
     QString m_definingFunc;
     FunctionDefs m_functionDefs;
@@ -330,6 +331,7 @@ ProFileEvaluator::Private::Private(ProFileEvaluator *q_, ProFileOption *option)
     m_invertNext = false;
     m_skipLevel = 0;
     m_definingFunc.clear();
+    m_listCount = 0;
 }
 
 ProFileEvaluator::Private::~Private()
@@ -1951,9 +1953,8 @@ QStringList ProFileEvaluator::Private::evaluateExpandFunction(const QString &fun
             }
             break;
         case E_LIST: {
-            static int x = 0;
             QString tmp;
-            tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", x++);
+            tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++);
             ret = QStringList(tmp);
             QStringList lst;
             foreach (const QString &arg, args)
-- 
GitLab