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:
parent
72e0dffa3d
commit
af7be7e395
1 changed files with 7 additions and 7 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue