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

Bug 546619 - NPE in CPPClosureType.isSameType()

Change-Id: I0a529f439c1422b89a9c5fca855c2c75818f9927
Signed-off-by: Hannes Vogt <hannes@havogt.de>
This commit is contained in:
Hannes Vogt 2019-04-21 23:10:40 +02:00 committed by Nathan Ridge
parent 3fcbb5c7b5
commit bf9575d365
2 changed files with 3 additions and 0 deletions

View file

@ -36,6 +36,7 @@ public interface IType extends Cloneable {
* See {@link ICPPTemplateTemplateParameter#isSameType(IType)} or * See {@link ICPPTemplateTemplateParameter#isSameType(IType)} or
* {@link ICPPTemplateTypeParameter#isSameType(IType)} for the semantics of comparing template * {@link ICPPTemplateTypeParameter#isSameType(IType)} for the semantics of comparing template
* parameters denoting types. * parameters denoting types.
* @param type can be {@code null}.
*/ */
public boolean isSameType(IType type); public boolean isSameType(IType type);
} }

View file

@ -325,6 +325,8 @@ public class CPPClosureType extends PlatformObject implements ICPPClassType, ICP
@Override @Override
public boolean isSameType(IType type) { public boolean isSameType(IType type) {
if (type == null)
return false;
if (type == this) if (type == this)
return true; return true;
if (type instanceof ITypedef || type instanceof IIndexBinding) if (type instanceof ITypedef || type instanceof IIndexBinding)