1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 145245 - Added check in CPPASTTemplateId to detect that we're recursing and return null if we are. I also had to change CPPClassScope a little which wasn't expecting the null.

This commit is contained in:
Doug Schaefer 2006-06-09 17:50:30 +00:00
parent 7279f74fd0
commit 52d99fabef
2 changed files with 9 additions and 5 deletions

View file

@ -65,13 +65,18 @@ public class CPPASTTemplateId extends CPPASTNode implements ICPPASTTemplateId, I
private IASTNode [] templateArguments = null;
private IBinding binding = null;
private boolean resolving = false;
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IASTName#resolveBinding()
*/
public IBinding resolveBinding() {
if( binding == null )
binding = CPPTemplates.createBinding( this );
if (binding == null && !resolving) {
// protect for infinite recursion
resolving = true;
binding = CPPTemplates.createBinding( this );
resolving = false;
}
return binding;
}

View file

@ -255,9 +255,8 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
Object obj = set.keyAt( i );
if( obj instanceof IASTName ){
IASTName n = (IASTName) obj;
binding = n.getBinding();
if( binding != null || forceResolve ){
binding = n.resolveBinding();
binding = forceResolve ? n.resolveBinding() : n.getBinding();
if( binding != null ) {
set.remove( n );
set.put( binding );
i--;