1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Bug 431596 - NPE in BindingCollector.leave.

This commit is contained in:
Sergey Prigogin 2014-04-01 10:17:59 -07:00
parent 8c3ba9ec2d
commit 5850c01893

View file

@ -972,10 +972,12 @@ public class BindingClassifier {
* }
*/
IASTUnaryExpression unaryExpression = (IASTUnaryExpression) expression;
IASTExpression operand = unaryExpression.getOperand();
if (operand != null) { // A throw expression may have no operand.
if (unaryExpression instanceof ICPPASTUnaryExpression) {
ICPPFunction overload = ((ICPPASTUnaryExpression) unaryExpression).getOverload();
if (overload != null) {
defineFunction(overload, new IASTInitializerClause[] { unaryExpression.getOperand() });
defineFunction(overload, new IASTInitializerClause[] { operand });
return PROCESS_CONTINUE;
}
}
@ -993,13 +995,14 @@ public class BindingClassifier {
case IASTUnaryExpression.op_sizeof:
case IASTUnaryExpression.op_typeid:
// If the operand is a pointer type, then it doesn't need to be defined.
if (unaryExpression.getOperand().getExpressionType() instanceof IPointerType) {
if (operand.getExpressionType() instanceof IPointerType) {
expressionDefinitionRequired = false;
}
}
if (expressionDefinitionRequired) {
defineTypeExceptTypedefOrNonFixedEnum(unaryExpression.getOperand().getExpressionType());
defineTypeExceptTypedefOrNonFixedEnum(operand.getExpressionType());
}
}
} else if (expression instanceof IASTBinaryExpression) {
/*