mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Added protection against ClassCastException
Change-Id: Ib14420d944c840ebda24305530f82142998cfe5c
This commit is contained in:
parent
52eb5f7b02
commit
662091c72d
1 changed files with 7 additions and 2 deletions
|
@ -88,8 +88,13 @@ public final class ExecDeclarator implements ICPPExecution {
|
|||
} else if (isPointerType(nestedType) && !isCStringType(nestedType)) {
|
||||
return createPointerValue(record, context, computedInitializerEval);
|
||||
} else if (isArrayType(nestedType) && !isCStringType(nestedType)) {
|
||||
IValue value = CompositeValue.create((EvalInitList) computedInitializerEval,(IArrayType) (type));
|
||||
return new EvalFixed(type, computedInitializerEval.getValueCategory(context.getPoint()), value);
|
||||
if (computedInitializerEval instanceof EvalInitList) {
|
||||
IValue value = CompositeValue.create((EvalInitList) computedInitializerEval, (IArrayType) (type));
|
||||
return new EvalFixed(type, computedInitializerEval.getValueCategory(context.getPoint()), value);
|
||||
} else {
|
||||
// TODO(sprigogin): Should something else be done here?
|
||||
return EvalFixed.INCOMPLETE;
|
||||
}
|
||||
} else if (isValueInitialization(computedInitializerEval)) {
|
||||
ICPPEvaluation defaultValue = new EvalTypeId(type, context.getPoint(), false, new ICPPEvaluation[]{});
|
||||
return new EvalFixed(type, defaultValue.getValueCategory(context.getPoint()), defaultValue.getValue(context.getPoint()));
|
||||
|
|
Loading…
Add table
Reference in a new issue