Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-02-22 05:10:07 +0000
committerNathan Ridge2018-02-25 23:05:18 +0000
commit37dfcc486e2346578001f0ab779d8ba22efc1e41 (patch)
tree8da37b46ef4f26801b5ea1690cb804b41b090051
parent337ba422b6e83dfbe683261e7ed539ba240e77cc (diff)
downloadorg.eclipse.cdt-37dfcc486e2346578001f0ab779d8ba22efc1e41.tar.gz
org.eclipse.cdt-37dfcc486e2346578001f0ab779d8ba22efc1e41.tar.xz
org.eclipse.cdt-37dfcc486e2346578001f0ab779d8ba22efc1e41.zip
Bug 531475 - Push a lookup point when precomputing variable types and initial values in PDOMWriter.resolveNames()
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
index a0ff9786c0..c27413fd19 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java
@@ -428,9 +428,19 @@ public abstract class PDOMWriter implements IPDOMASTProcessor {
// to the index.
for (ICPPInternalDeclaredVariable variable : variables) {
if (isVariableIndexed(variable)) {
- // Type and initial value will be cached by the variable.
- variable.getType();
- variable.getInitialValue();
+ IASTNode lookupPoint = variable.getDefinition() != null
+ ? variable.getDefinition()
+ : (variable.getDeclarations() != null && variable.getDeclarations().length > 0)
+ ? variable.getDeclarations()[0]
+ : data.fAST;
+ CPPSemantics.pushLookupPoint(lookupPoint);
+ try {
+ // Type and initial value will be cached by the variable.
+ variable.getType();
+ variable.getInitialValue();
+ } finally {
+ CPPSemantics.popLookupPoint();
+ }
}
}

Back to the top