Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
a2ded1e8
Commit
a2ded1e8
authored
Mar 12, 2010
by
Erik Verbruggen
Browse files
Added boundary check.
parent
933ef8cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/ExpressionUnderCursor.cpp
View file @
a2ded1e8
...
...
@@ -147,11 +147,13 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
--
i
;
}
int
j
=
i
;
while
(
tk
[
j
].
is
(
T_LBRACKET
))
++
j
;
if
(
tk
[
j
].
is
(
T_IDENTIFIER
)
&&
tk
[
j
+
1
].
is
(
T_IDENTIFIER
))
return
i
;
if
(
i
>=
0
)
{
int
j
=
i
;
while
(
tk
[
j
].
is
(
T_LBRACKET
))
++
j
;
if
(
tk
[
j
].
is
(
T_IDENTIFIER
)
&&
tk
[
j
+
1
].
is
(
T_IDENTIFIER
))
return
i
;
}
}
return
index
-
1
;
}
else
if
(
tk
[
index
-
1
].
is
(
T_RPAREN
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment