summaryrefslogtreecommitdiffstats
path: root/src/linguist/shared/qmakeevaluator.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-11 14:55:37 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-09-14 13:49:36 +0000
commitf8954106d926d4786b4c36e172fae25e97c1bdf7 (patch)
treec6b73514243ccfda04e90de090aebab422b3deb9 /src/linguist/shared/qmakeevaluator.cpp
parenta0efbd756f56e85f43c5ba2eb3019619382e9b68 (diff)
qmake: fix raw data detach avoidance
the m_tmp array is a member, so the index toggle for accessing it also needs to be one - otherwise, odd iteration counts will defeat the mechanism. Change-Id: If7a800ed5a4b4168625daf1ebbd5d2d164569d8e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from qtbase/ccb8afcda752093bfb6bc32f560131a91bd826a1) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/linguist/shared/qmakeevaluator.cpp')
-rw-r--r--src/linguist/shared/qmakeevaluator.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp
index c1adf07bc..2e4ad1808 100644
--- a/src/linguist/shared/qmakeevaluator.cpp
+++ b/src/linguist/shared/qmakeevaluator.cpp
@@ -226,6 +226,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeV
m_skipLevel = 0;
#endif
m_listCount = 0;
+ m_toggle = 0;
m_valuemapStack.push(ProValueMap());
m_valuemapInited = false;
}
@@ -1638,12 +1639,10 @@ bool QMakeEvaluator::isActiveConfig(const QStringRef &config, bool regex)
return true;
// CONFIG variable
- int t = 0;
const auto configValues = values(statics.strCONFIG);
for (const ProString &configValue : configValues) {
- if (re.exactMatch(configValue.toQString(m_tmp[t])))
+ if (re.exactMatch(configValue.toQString(m_tmp[m_toggle ^= 1])))
return true;
- t ^= 1;
}
} else {
// mkspecs