Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-03-22 22:46:08 +0000
committerNathan Ridge2018-03-30 06:02:59 +0000
commitd598331c81b730a071e85b40b125dd6db9556e3e (patch)
treecabb1cdedb4b0ba0e8fddfdf17df7ca24f8353ff
parent0f9d2cdbbada16cbbbf623e12b003d1407fb5d30 (diff)
downloadorg.eclipse.cdt-d598331c81b730a071e85b40b125dd6db9556e3e.tar.gz
org.eclipse.cdt-d598331c81b730a071e85b40b125dd6db9556e3e.tar.xz
org.eclipse.cdt-d598331c81b730a071e85b40b125dd6db9556e3e.zip
Bug 532684 - NPE in PDOMMacroReferenceName constructor
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMMacroReferenceName.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMMacroReferenceName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMMacroReferenceName.java
index 65a11e802a..ecddd3214e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMMacroReferenceName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMMacroReferenceName.java
@@ -56,8 +56,8 @@ public final class PDOMMacroReferenceName implements IIndexFragmentName {
// Record our location in the file
IASTFileLocation fileloc = name.getFileLocation();
- db.putInt(record + NODE_OFFSET_OFFSET, fileloc.getNodeOffset());
- db.putShort(record + NODE_LENGTH_OFFSET, (short) fileloc.getNodeLength());
+ db.putInt(record + NODE_OFFSET_OFFSET, fileloc != null ? fileloc.getNodeOffset() : 0);
+ db.putShort(record + NODE_LENGTH_OFFSET, fileloc != null ? (short) fileloc.getNodeLength() : 0);
container.addReference(this);
if (caller != null) {

Back to the top