1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Check for cast-expression before checking for unary expression.

This commit is contained in:
Markus Schorn 2008-11-10 14:40:39 +00:00
parent e4e1fe133d
commit 64399b14a2
2 changed files with 6 additions and 6 deletions

View file

@ -174,12 +174,12 @@ public class Value implements IValue {
if (e instanceof IASTBinaryExpression) {
return evaluateBinaryExpression((IASTBinaryExpression) e, maxdepth);
}
if (e instanceof IASTCastExpression) { // must be ahead of unary
return evaluate(((IASTCastExpression) e).getOperand(), maxdepth);
}
if (e instanceof IASTUnaryExpression) {
return evaluateUnaryExpression((IASTUnaryExpression) e, maxdepth);
}
if (e instanceof IASTCastExpression) {
return evaluate(((IASTCastExpression) e).getOperand(), maxdepth);
}
if (e instanceof IASTConditionalExpression) {
IASTConditionalExpression cexpr= (IASTConditionalExpression) e;
Object o= evaluate(cexpr.getLogicalConditionExpression(), maxdepth);

View file

@ -92,6 +92,9 @@ public abstract class VariableReadWriteFlags {
if (expr instanceof IASTBinaryExpression) {
return rwInBinaryExpression(node, (IASTBinaryExpression) expr, indirection);
}
if (expr instanceof IASTCastExpression) { // must be ahead of unary
return rwAnyNode(expr, indirection);
}
if (expr instanceof IASTUnaryExpression) {
return rwInUnaryExpression(node, (IASTUnaryExpression) expr, indirection);
}
@ -101,9 +104,6 @@ public abstract class VariableReadWriteFlags {
}
return READ;
}
if (expr instanceof IASTCastExpression) {
return rwAnyNode(expr, indirection);
}
if (expr instanceof IASTConditionalExpression) {
if (node.getPropertyInParent() == IASTConditionalExpression.LOGICAL_CONDITION) {
return READ;