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:
parent
3780016b4b
commit
a71ce1e482
1 changed files with 9 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue