forked from qt-creator/qt-creator
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:
@@ -646,11 +646,11 @@ static ALWAYS_INLINE void addStrList(
|
|||||||
ret->last().append(list);
|
ret->last().append(list);
|
||||||
} else {
|
} else {
|
||||||
if (!pending) {
|
if (!pending) {
|
||||||
pending = true;
|
|
||||||
// Another qmake bizzarity: if nothing is pending and the
|
// Another qmake bizzarity: if nothing is pending and the
|
||||||
// first element is empty, it will be eaten
|
// first element is empty, it will be eaten
|
||||||
if (!list.at(0).isEmpty()) {
|
if (!list.at(0).isEmpty()) {
|
||||||
// The common case
|
// The common case
|
||||||
|
pending = true;
|
||||||
*ret += list;
|
*ret += list;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -658,12 +658,14 @@ static ALWAYS_INLINE void addStrList(
|
|||||||
ret->last().append(list.at(0));
|
ret->last().append(list.at(0));
|
||||||
}
|
}
|
||||||
// This is somewhat slow, but a corner case
|
// 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);
|
*ret << list.at(j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProFileEvaluator::Private::evaluateExpression(
|
void ProFileEvaluator::Private::evaluateExpression(
|
||||||
const ushort *&tokPtr, ProStringList *ret, bool joined)
|
const ushort *&tokPtr, ProStringList *ret, bool joined)
|
||||||
|
|||||||
Reference in New Issue
Block a user