forked from qt-creator/qt-creator
C++: Fix crash on '{' press
Introduced by 0629400
.
Sometimes typing '{' after class crashes QtC.
Task-number: QTCREATORBUG-19726
Change-Id: Idbbfaaa21837ec4afbe7debbd80ddaa484120f09
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -347,7 +347,7 @@ static bool recordLikeMightFollowToken(const Token &token)
|
|||||||
|
|
||||||
static bool isAfterRecordLikeDefinition(const BackwardsScanner &tokens, int index)
|
static bool isAfterRecordLikeDefinition(const BackwardsScanner &tokens, int index)
|
||||||
{
|
{
|
||||||
for (;; --index) {
|
for (; index >= 0; --index) {
|
||||||
if (recordLikeHasToFollowToken(tokens[index]))
|
if (recordLikeHasToFollowToken(tokens[index]))
|
||||||
return isRecordLikeToken(tokens, index + 1);
|
return isRecordLikeToken(tokens, index + 1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user