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

avoid infinite recursive loop (caused by malformed AST) by requiring that the declaration of the type of a function parameter occurs before

the start of that function's declarator
This commit is contained in:
Andrew Niefer 2005-04-11 23:23:15 +00:00
parent b4a9f10228
commit 975dc239e9

View file

@ -1383,6 +1383,16 @@ public class CPPSemantics {
} else if( obj instanceof ASTNode ){
nd = (ASTNode) obj;
}
//avoid recursive loops in case of a malformed AST by requiring the decl of the type of a function parameter
//to occur before the start of that function's declarator.
if( node instanceof IASTName && node.getPropertyInParent() == IASTNamedTypeSpecifier.NAME ) {
IASTNode n = node.getParent();
if( n.getPropertyInParent() == IASTParameterDeclaration.DECL_SPECIFIER ){
node = (ASTNode) n.getParent().getParent(); //parent is param, parent.parent is fnDtor
}
}
if( nd != null ){
int pointOfDecl = 0;
ASTNodeProperty prop = nd.getPropertyInParent();