assignment-related crash fix

when appending a list with one empty element to an empty list, we'd get
into a state which would subsequently cause an assert.
This commit is contained in:
Oswald Buddenhagen
2010-06-24 14:49:35 +02:00
parent cc86968051
commit 4cd0281f63

View File

@@ -646,11 +646,11 @@ static ALWAYS_INLINE void addStrList(
ret->last().append(list);
} else {
if (!pending) {
pending = true;
// Another qmake bizzarity: if nothing is pending and the
// first element is empty, it will be eaten
if (!list.at(0).isEmpty()) {
// The common case
pending = true;
*ret += list;
return;
}
@@ -658,12 +658,14 @@ static ALWAYS_INLINE void addStrList(
ret->last().append(list.at(0));
}
// This is somewhat slow, but a corner case
for (int j = 1; j < list.size(); ++j)
for (int j = 1; j < list.size(); ++j) {
pending = true;
*ret << list.at(j);
}
}
}
}
}
void ProFileEvaluator::Private::evaluateExpression(
const ushort *&tokPtr, ProStringList *ret, bool joined)