diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-03-11 18:11:53 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-03-12 11:32:42 +0100 |
commit | 933ef8cff0636f7a5db93909773b09dc4eb4aad3 (patch) | |
tree | 4498fd30caf7bd631ccf37260b8b6a4db09d948b /src/libs/cplusplus/ExpressionUnderCursor.cpp | |
parent | b737fb861df9abe3214772f80ea8fd7a4434ff35 (diff) | |
download | qt-creator-933ef8cff0636f7a5db93909773b09dc4eb4aad3.tar.gz |
Added bounds check.
Diffstat (limited to 'src/libs/cplusplus/ExpressionUnderCursor.cpp')
-rw-r--r-- | src/libs/cplusplus/ExpressionUnderCursor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/cplusplus/ExpressionUnderCursor.cpp b/src/libs/cplusplus/ExpressionUnderCursor.cpp index 3886d03bd0..d8c7fc55fb 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.cpp +++ b/src/libs/cplusplus/ExpressionUnderCursor.cpp @@ -136,7 +136,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in // [receiver messageParam1:expression messageParam2:expression messageParam3 // ... etc int i = index - 1; - while (tk[i].isNot(T_EOF_SYMBOL)) { + while (i >= 0 && tk[i].isNot(T_EOF_SYMBOL)) { if (tk[i].is(T_LBRACKET)) break; if (tk[i].is(T_LBRACE) || tk[i].is(T_RBRACE)) |