1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 535557 - Avoid setting a null lookup point in SizeofCalculator.sizeAndAlignment()

Change-Id: I50974c7b74ef511aae96e2ce2a9a3b96ecbdb594
This commit is contained in:
Nathan Ridge 2018-06-06 09:02:57 -04:00
parent 2ca147ebf1
commit 8792d9d5a6

View file

@ -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();