mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Fix for 176842, indexer hangs on code with missing closing bracket
This commit is contained in:
parent
cb14d91f76
commit
84e36a84f9
2 changed files with 7 additions and 2 deletions
|
@ -1839,9 +1839,13 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
|||
templateIdScopes.push(IToken.tLPAREN);
|
||||
}
|
||||
IASTExpression lhs = expression();
|
||||
int finalOffset = Integer.MAX_VALUE;
|
||||
if (LT(1) == IToken.tRPAREN)
|
||||
int finalOffset= 0;
|
||||
if (LT(1) == IToken.tRPAREN) {
|
||||
finalOffset = consume().getEndOffset();
|
||||
} else {
|
||||
// missing parenthesis, assume it's there and keep going.
|
||||
finalOffset = LA(1).getOffset();
|
||||
}
|
||||
if (templateIdScopes.size() > 0) {
|
||||
templateIdScopes.pop();
|
||||
}
|
||||
|
|
|
@ -1892,6 +1892,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
_WeightedContext[] result = new _WeightedContext[2];
|
||||
_Context cc = null;
|
||||
int currentCount = 0;
|
||||
length= Math.min(tu.context_ends, length);
|
||||
for (int i = offset; i < offset + length; ++i) {
|
||||
_Context r = tu.findContextContainingOffset(i);
|
||||
if (cc == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue