1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

New parser fixes.

Remove NPE in consumeArrayModifiers().
Add stronger typing to bitfield expression in declarator().
This commit is contained in:
John Camelon 2004-11-22 15:10:37 +00:00
parent fa0262f964
commit cf15755c35

View file

@ -1587,7 +1587,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
List parameters = Collections.EMPTY_LIST;
List arrayMods = Collections.EMPTY_LIST;
boolean encounteredVarArgs = false;
Object bitField = null;
IASTExpression bitField = null;
boolean isFunction = false;
overallLoop: do {
@ -1720,7 +1720,7 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
}
else if (bitField != null) {
IASTFieldDeclarator fl = createFieldDeclarator();
fl.setBitFieldSize((IASTExpression) bitField);
fl.setBitFieldSize(bitField);
d = fl;
} else
{
@ -1840,10 +1840,13 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
}
arrayMod = temp;
}
arrayMod.setConstantExpression( exp );
((CASTNode)arrayMod).setOffset( startOffset );
exp.setParent( arrayMod );
exp.setPropertyInParent( IASTArrayModifier.CONSTANT_EXPRESSION );
if( exp != null )
{
arrayMod.setConstantExpression( exp );
exp.setParent( arrayMod );
exp.setPropertyInParent( IASTArrayModifier.CONSTANT_EXPRESSION );
}
arrayMods.add( arrayMod );
}
}