1
0
Fork 0
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:
John Camelon 2004-05-25 01:09:58 +00:00
parent 18de33d8a9
commit 29fdfabb37

View file

@ -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