Commit a2ded1e8 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Added boundary check.

parent 933ef8cf
......@@ -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)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment