1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 318552: NPE in ExpressionWriter for unary expression without an operand

https://bugs.eclipse.org/bugs/show_bug.cgi?id=318552
This commit is contained in:
Emanuel Graf 2010-07-01 08:12:10 +00:00
parent fe6b056773
commit 368736adaf
2 changed files with 15 additions and 1 deletions

View file

@ -159,6 +159,20 @@ void f()
type_info c = typeid (a);
//!CPPUnaryExpression without operand Bug 318552
//%CPP
void rethrow()
{
try {
int i = 1;
throw i;
}
catch(int j){
throw ;
}
}
//!TypeIdExpression
//%CPP
int d = sizeof (int);

View file

@ -383,7 +383,7 @@ public class ExpressionWriter extends NodeWriter{
if(isPrefixExpression(unExp )) {
scribe.print(getPrefixOperator(unExp));
}
unExp.getOperand().accept(visitor);
visitNodeIfNotNull(unExp.getOperand());
if(isPostfixExpression(unExp)) {
scribe.print(getPostfixOperator(unExp));
}