Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNathan Ridge2018-01-02 00:58:49 +0000
committerNathan Ridge2018-01-10 05:04:19 +0000
commit2b7188c9a5baaee90ae7187aa8d4a988ae76f1ee (patch)
tree110ec9c899301e337f5d73cfa59b83544733bc91 /core
parent92bc379917ecf365261385dc98c70e618fa1fe58 (diff)
downloadorg.eclipse.cdt-2b7188c9a5baaee90ae7187aa8d4a988ae76f1ee.tar.gz
org.eclipse.cdt-2b7188c9a5baaee90ae7187aa8d4a988ae76f1ee.tar.xz
org.eclipse.cdt-2b7188c9a5baaee90ae7187aa8d4a988ae76f1ee.zip
Bug 529337 - NPE in PDOMCPPLinkage.onCreateNameHelper()
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index f0ba1b38675..5a6ec404f77 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -22,6 +22,7 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -1008,7 +1009,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
pdomBinding = createBinding(type, method, fileLocalRec);
} else if (!getPDOM().hasLastingDefinition(pdomBinding)) {
pdomBinding.update(this, method);
- old.remove(pdomBinding);
+ old.remove((ICPPMethod) pdomBinding);
// Update the tags based on the tags from the new binding. This was in
// PDOMBinding.update, but not all subclasses (e.g., PDOMCPPFunction)
@@ -1434,9 +1435,12 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
}
if (doit) {
long rec= file.getLastUsingDirectiveRec();
- PDOMCPPUsingDirective ud= new PDOMCPPUsingDirective(this, rec, containerNS,
- pdomName.getBinding(), pdomName.getFileLocation().getNodeOffset());
- file.setLastUsingDirective(ud.getRecord());
+ IASTFileLocation fileLoc = pdomName.getFileLocation();
+ if (fileLoc != null) {
+ PDOMCPPUsingDirective ud= new PDOMCPPUsingDirective(this, rec, containerNS,
+ pdomName.getBinding(), fileLoc.getNodeOffset());
+ file.setLastUsingDirective(ud.getRecord());
+ }
}
} else if (parentNode instanceof ICPPASTElaboratedTypeSpecifier) {
ICPPASTElaboratedTypeSpecifier elaboratedSpecifier = (ICPPASTElaboratedTypeSpecifier) parentNode;

Back to the top