Commit 30bd7fcc authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

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.

Task-number: QTCREATORBUG-1595
Change-Id: I7783e318fbc2790f6a853ba4e3f4a12db881feb5
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 27c87624
......@@ -882,30 +882,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: // *=
......@@ -921,7 +900,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment