diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-11-15 19:28:50 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-15 19:28:50 +0100 |
commit | 71454fbb13f22d17aba6f8b356061ea6f81aea0b (patch) | |
tree | 690561693006a536824c4cbb9188273833b75899 | |
parent | 3fabc1ffae016dd4e02bd425a68eccf82849f796 (diff) | |
download | qttools-71454fbb13f22d17aba6f8b356061ea6f81aea0b.tar.gz qttools-71454fbb13f22d17aba6f8b356061ea6f81aea0b.tar.bz2 qttools-71454fbb13f22d17aba6f8b356061ea6f81aea0b.zip |
don't turn = into += in cumulative mode
it leads to pathological cases where the number of loop iterations may
go way beyond the reasonable.
this means that users need to avoid using the = operator in alternative
branches that lead to different sources/subdirectories being included
into the project. this is a bit of a corner case anyway, as people
usually add directly to SOURCES/SUBDIRS.
Change-Id: I7783e318fbc2790f6a853ba4e3f4a12db881feb5
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/30bd7fcce1aef974f6af9eaa6532aa1f2b6192d2)
-rw-r--r-- | src/linguist/shared/qmakeevaluator.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp index 07afedce..08b38414 100644 --- a/src/linguist/shared/qmakeevaluator.cpp +++ b/src/linguist/shared/qmakeevaluator.cpp @@ -894,30 +894,9 @@ void QMakeEvaluator::visitProVariable( default: // whatever - cannot happen case TokAssign: // = zipEmpty(&varVal); - if (!m_cumulative) { - // FIXME: add check+warning about accidental value removal. - // This may be a bit too noisy, though. - m_valuemapStack.top()[varName] = varVal; - } else { - if (!varVal.isEmpty()) { - // We are greedy for values. But avoid exponential growth. - ProStringList &v = valuesRef(varName); - if (v.isEmpty()) { - v = varVal; - } else { - ProStringList old = v; - v = varVal; - QSet<ProString> has; - has.reserve(v.size()); - foreach (const ProString &s, v) - has.insert(s); - v.reserve(v.size() + old.size()); - foreach (const ProString &s, old) - if (!has.contains(s)) - v << s; - } - } - } + // FIXME: add check+warning about accidental value removal. + // This may be a bit too noisy, though. + m_valuemapStack.top()[varName] = varVal; debugMsg(2, "assigning"); break; case TokAppendUnique: // *= @@ -933,7 +912,7 @@ void QMakeEvaluator::visitProVariable( if (!m_cumulative) { removeEach(&valuesRef(varName), varVal); } else { - // We are stingy with our values, too. + // We are stingy with our values. } debugMsg(2, "removing"); break; |