1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Bug 510662 - NPE in BuiltinOperators.<init>

Change-Id: I699a45e762dcc00593b0000c2cd3ecd5f2515773
This commit is contained in:
Sergey Prigogin 2017-01-27 21:17:56 -08:00
parent 2647895966
commit 5aed7a6411
4 changed files with 5 additions and 5 deletions

View file

@ -95,12 +95,12 @@ public final class CompositeValue implements IValue {
return 0 <= index && index < values.length;
}
public static IValue create(EvalInitList initList) {
public static IValue create(EvalInitList initList, IASTNode point) {
ICPPEvaluation[] clauses = initList.getClauses();
ICPPEvaluation[] values = new ICPPEvaluation[clauses.length];
for (int i = 0; i < clauses.length; i++) {
ICPPEvaluation eval = clauses[i];
values[i] = new EvalFixed(eval.getType(null), eval.getValueCategory(null), eval.getValue(null));
values[i] = new EvalFixed(eval.getType(point), eval.getValueCategory(point), eval.getValue(point));
}
return new CompositeValue(initList, values);
}

View file

@ -250,7 +250,7 @@ public class CPPVariable extends PlatformObject implements ICPPInternalVariable
return null;
}
if (!initEval.isValueDependent() ) {
IASTNode point = fDefinition != null ? fDefinition : fDeclarations[0];
IASTNode point = fDefinition != null ? fDefinition : fDeclarations[0];
return initEval.getValue(point);
}
return DependentValue.create(initEval);

View file

@ -96,7 +96,7 @@ public class EvalInitList extends CPPDependentEvaluation {
if (isValueDependent()) {
return DependentValue.create(this);
}
return CompositeValue.create(this);
return CompositeValue.create(this, point);
}
@Override

View file

@ -148,7 +148,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
if (fInputType instanceof ICPPClassType) {
ICPPClassType classType = (ICPPClassType) fInputType;
IBinding ctor = getConstructor(null);
IBinding ctor = getConstructor(point);
if (EvalUtil.isCompilerGeneratedCtor(ctor)) {
return CompositeValue.create(classType);
} else if (ctor == AGGREGATE_INITIALIZATION) {