1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 522459 - NPE in ExecRangeBasedFor.loopOverArray()

Change-Id: Ife66cef5ca07655371bf83489881d9f2baf61f92
This commit is contained in:
Nathan Ridge 2017-09-19 00:05:54 -04:00
parent f849b09679
commit 2a94c46209

View file

@ -133,6 +133,9 @@ public class ExecRangeBasedFor implements ICPPExecution {
ICPPEvaluation valueRange = initClauseEval.computeForFunctionCall(record, context.recordStep());
ExecDeclarator declaratorExec = (ExecDeclarator) declarationExec.getDeclaratorExecutions()[0];
IVariable rangeVar = (IVariable) declaratorExec.getDeclaredBinding();
if (rangeVar == null) {
return ExecIncomplete.INSTANCE;
}
boolean rangeIsConst = SemanticUtil.isConst(initClauseEval.getType(context.getPoint()));
IType type = SemanticUtil.getNestedType(valueRange.getType(context.getPoint()), ALLCVQ | TDEF | REF);