mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed loop-detection code in Parser:cInitializer.
This commit is contained in:
parent
18de33d8a9
commit
29fdfabb37
1 changed files with 2 additions and 2 deletions
|
@ -1894,7 +1894,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
List initializerList = new ArrayList();
|
List initializerList = new ArrayList();
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
int checkOffset = LA(1).getOffset();
|
int checkOffset = LA(1).hashCode();
|
||||||
// required at least one initializer list
|
// required at least one initializer list
|
||||||
// get designator list
|
// get designator list
|
||||||
List newDesignators = designatorList(scope);
|
List newDesignators = designatorList(scope);
|
||||||
|
@ -1912,7 +1912,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
||||||
consume(IToken.tCOMMA);
|
consume(IToken.tCOMMA);
|
||||||
if (LT(1) == IToken.tRBRACE)
|
if (LT(1) == IToken.tRBRACE)
|
||||||
break;
|
break;
|
||||||
if( checkOffset == LA(1).getOffset())
|
if( checkOffset == LA(1).hashCode())
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
|
|
||||||
// otherwise, its another initializer in the list
|
// otherwise, its another initializer in the list
|
||||||
|
|
Loading…
Add table
Reference in a new issue