mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Bug 510662 - NPE in BuiltinOperators.<init>
Change-Id: I699a45e762dcc00593b0000c2cd3ecd5f2515773
This commit is contained in:
parent
2647895966
commit
5aed7a6411
4 changed files with 5 additions and 5 deletions
|
@ -95,12 +95,12 @@ public final class CompositeValue implements IValue {
|
||||||
return 0 <= index && index < values.length;
|
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[] clauses = initList.getClauses();
|
||||||
ICPPEvaluation[] values = new ICPPEvaluation[clauses.length];
|
ICPPEvaluation[] values = new ICPPEvaluation[clauses.length];
|
||||||
for (int i = 0; i < clauses.length; i++) {
|
for (int i = 0; i < clauses.length; i++) {
|
||||||
ICPPEvaluation eval = clauses[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);
|
return new CompositeValue(initList, values);
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ public class CPPVariable extends PlatformObject implements ICPPInternalVariable
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!initEval.isValueDependent() ) {
|
if (!initEval.isValueDependent() ) {
|
||||||
IASTNode point = fDefinition != null ? fDefinition : fDeclarations[0];
|
IASTNode point = fDefinition != null ? fDefinition : fDeclarations[0];
|
||||||
return initEval.getValue(point);
|
return initEval.getValue(point);
|
||||||
}
|
}
|
||||||
return DependentValue.create(initEval);
|
return DependentValue.create(initEval);
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class EvalInitList extends CPPDependentEvaluation {
|
||||||
if (isValueDependent()) {
|
if (isValueDependent()) {
|
||||||
return DependentValue.create(this);
|
return DependentValue.create(this);
|
||||||
}
|
}
|
||||||
return CompositeValue.create(this);
|
return CompositeValue.create(this, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class EvalTypeId extends CPPDependentEvaluation {
|
||||||
|
|
||||||
if (fInputType instanceof ICPPClassType) {
|
if (fInputType instanceof ICPPClassType) {
|
||||||
ICPPClassType classType = (ICPPClassType) fInputType;
|
ICPPClassType classType = (ICPPClassType) fInputType;
|
||||||
IBinding ctor = getConstructor(null);
|
IBinding ctor = getConstructor(point);
|
||||||
if (EvalUtil.isCompilerGeneratedCtor(ctor)) {
|
if (EvalUtil.isCompilerGeneratedCtor(ctor)) {
|
||||||
return CompositeValue.create(classType);
|
return CompositeValue.create(classType);
|
||||||
} else if (ctor == AGGREGATE_INITIALIZATION) {
|
} else if (ctor == AGGREGATE_INITIALIZATION) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue