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

Bug 510152: ParserException in ASTAmbiguousNode.logAmbiguousNodeError

If the fOperand of an CPPASTUnaryExpression is an ASTAmbiguousNode
the fOperand.getEvaluation() call will always fail and log an error.

Change-Id: Ie17c2685636e8956bf4724c206092cf0370ff5d9
Signed-off-by: Hansruedi Patzen <hansruedi.patzen@hsr.ch>
This commit is contained in:
Hansruedi Patzen 2018-09-10 18:06:37 +02:00 committed by Nathan Ridge
parent 5042be3a36
commit b8618b166a

View file

@ -31,6 +31,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUnaryExpression;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousNode;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPEvaluation;
@ -201,7 +202,7 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
}
private ICPPEvaluation computeEvaluation() {
if (fOperand == null)
if (fOperand == null || fOperand instanceof ASTAmbiguousNode)
return EvalFixed.INCOMPLETE;
final ICPPEvaluation nestedEval = fOperand.getEvaluation();