1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

Fixed an NPE.

This commit is contained in:
Sergey Prigogin 2008-12-27 18:09:39 +00:00
parent 72e0dffa3d
commit af7be7e395

View file

@ -1966,7 +1966,7 @@ public class CPPVisitor extends ASTQueries {
return ((ITypeContainer) type).getType();
}
return new ProblemBinding(expression, IProblemBinding.SEMANTIC_INVALID_TYPE,
("*" + type.toString()).toCharArray()); //$NON-NLS-1$
expression.getRawSignature().toCharArray());
} catch (DOMException e) {
return e.getProblem();
}
@ -2410,18 +2410,18 @@ public class CPPVisitor extends ASTQueries {
/**
* Searches for the first function, class or namespace enclosing the declaration the provided
* node belongs to and returns the binding for it. Returns <code>null</code>, if the declaration is not
* enclosed by any of the above constructs.
* node belongs to and returns the binding for it. Returns <code>null</code>, if the declaration
* is not enclosed by any of the above constructs.
*/
public static IBinding findDeclarationOwner(IASTNode node, boolean allowFunction) {
// search for declaration
// Search for declaration
while (!(node instanceof IASTDeclaration)) {
if (node == null)
return null;
node= node.getParent();
}
// search for enclosing binding
// Search for enclosing binding
IASTName name= null;
node= node.getParent();
for (; node != null; node= node.getParent()) {