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

Fix NPEs in qualified names

This commit is contained in:
Andrew Niefer 2005-03-22 19:13:50 +00:00
parent 3780016b4b
commit a71ce1e482

View file

@ -1517,10 +1517,14 @@ public class CPPVisitor {
try {
ICPPScope scope = (ICPPScope) binding.getScope();
while( scope != null ){
IASTName n = scope.getScopeName();
if( n == null )
break;
if( scope instanceof ICPPBlockScope || scope instanceof ICPPFunctionScope )
break;
if( scope instanceof ICPPNamespaceScope && scope.getScopeName().toCharArray().length == 0 )
break;
IASTName n = scope.getScopeName();
ns = (IASTName[]) ArrayUtil.append( IASTName.class, ns, n );
scope = (ICPPScope) scope.getParent();
}
@ -1540,11 +1544,14 @@ public class CPPVisitor {
try {
ICPPScope scope = (ICPPScope) binding.getScope();
while( scope != null ){
IASTName n = scope.getScopeName();
if( n == null )
break;
if( scope instanceof ICPPBlockScope || scope instanceof ICPPFunctionScope )
break;
if( scope instanceof ICPPNamespaceScope && scope.getScopeName().toCharArray().length == 0 )
break;
IASTName n = scope.getScopeName();
ns = (IASTName[]) ArrayUtil.append( IASTName.class, ns, n );
scope = (ICPPScope) scope.getParent();
}