summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-06-06 09:02:57 -0400
committerNathan Ridge2018-06-15 00:09:26 -0400
commit8792d9d5a6545fb938fe3bc92dc5825ee35c142d (patch)
treeb44cba2c74f506662ee45c1b43f6b1b5bc395f1b
parent2ca147ebf134be986a21b724291a33cbfba9d5ee (diff)
downloadorg.eclipse.cdt-8792d9d5a6545fb938fe3bc92dc5825ee35c142d.tar.gz
org.eclipse.cdt-8792d9d5a6545fb938fe3bc92dc5825ee35c142d.tar.xz
org.eclipse.cdt-8792d9d5a6545fb938fe3bc92dc5825ee35c142d.zip
Bug 535557 - Avoid setting a null lookup point in SizeofCalculator.sizeAndAlignment()
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
index 394325854c..699d450aa6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
@@ -291,7 +291,9 @@ public class SizeofCalculator {
int maxAlignment = 1;
IField[] fields;
if (type instanceof ICPPClassType) {
- CPPSemantics.pushLookupPoint(ast);
+ if (ast != null) {
+ CPPSemantics.pushLookupPoint(ast);
+ }
try {
ICPPClassType classType = (ICPPClassType) type;
for (ICPPBase base : classType.getBases()) {
@@ -315,7 +317,9 @@ public class SizeofCalculator {
}
fields = classType.getDeclaredFields();
} finally {
- CPPSemantics.popLookupPoint();
+ if (ast != null) {
+ CPPSemantics.popLookupPoint();
+ }
}
} else {
fields = type.getFields();