forked from qt-creator/qt-creator
ProjectExplorer: Fix crash
One must not call std::next() on a non-dereferenceable iterator. Change-Id: Id40341f808a3781f91f8aef1930bb76a397e8053 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -166,12 +166,12 @@ QList<QByteArray> Macro::tokenizeLine(const QByteArray &line)
|
||||
|
||||
const auto begin = normalizedLine.begin();
|
||||
auto first = std::find(normalizedLine.begin(), normalizedLine.end(), ' ');
|
||||
auto second = std::find(std::next(first), normalizedLine.end(), ' ');
|
||||
const auto end = normalizedLine.end();
|
||||
|
||||
QList<QByteArray> tokens;
|
||||
|
||||
if (first != end) {
|
||||
auto second = std::find(std::next(first), normalizedLine.end(), ' ');
|
||||
tokens.append(QByteArray(begin, int(std::distance(begin, first))));
|
||||
|
||||
std::advance(first, 1);
|
||||
|
Reference in New Issue
Block a user