Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Vogt2019-04-21 17:10:40 -0400
committerNathan Ridge2019-04-21 23:30:14 -0400
commitbf9575d365e3ccbe6f723236b0adc99a9b0717e9 (patch)
tree32c45797517faedf349375aec75187068b406972 /core/org.eclipse.cdt.core
parent3fcbb5c7b59b91713797f272ce5553783d748c70 (diff)
downloadorg.eclipse.cdt-bf9575d365e3ccbe6f723236b0adc99a9b0717e9.tar.gz
org.eclipse.cdt-bf9575d365e3ccbe6f723236b0adc99a9b0717e9.tar.xz
org.eclipse.cdt-bf9575d365e3ccbe6f723236b0adc99a9b0717e9.zip
Bug 546619 - NPE in CPPClosureType.isSameType()
Change-Id: I0a529f439c1422b89a9c5fca855c2c75818f9927 Signed-off-by: Hannes Vogt <hannes@havogt.de>
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java1
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
index 9e128fac2f..2d6bb8a35f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IType.java
@@ -36,6 +36,7 @@ public interface IType extends Cloneable {
* See {@link ICPPTemplateTemplateParameter#isSameType(IType)} or
* {@link ICPPTemplateTypeParameter#isSameType(IType)} for the semantics of comparing template
* parameters denoting types.
+ * @param type can be {@code null}.
*/
public boolean isSameType(IType type);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
index 4a17ae5873..8d06fab485 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClosureType.java
@@ -325,6 +325,8 @@ public class CPPClosureType extends PlatformObject implements ICPPClassType, ICP
@Override
public boolean isSameType(IType type) {
+ if (type == null)
+ return false;
if (type == this)
return true;
if (type instanceof ITypedef || type instanceof IIndexBinding)

Back to the top