File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,15 @@ exprt field_sensitivityt::get_fields(
180
180
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
181
181
else if (
182
182
ssa_expr.type ().id () == ID_array &&
183
- to_array_type (ssa_expr.type ()).size ().id () == ID_constant &&
184
- numeric_cast_v<mp_integer>(
185
- to_constant_expr (to_array_type (ssa_expr.type ()).size ())) <=
186
- max_field_sensitivity_array_size)
183
+ to_array_type (ssa_expr.type ()).size ().id () == ID_constant)
187
184
{
185
+ const mp_integer mp_array_size = numeric_cast_v<mp_integer>(
186
+ to_constant_expr (to_array_type (ssa_expr.type ()).size ()));
187
+ if (mp_array_size < 0 || mp_array_size > max_field_sensitivity_array_size)
188
+ return ssa_expr;
189
+
188
190
const array_typet &type = to_array_type (ssa_expr.type ());
189
- const std::size_t array_size =
190
- numeric_cast_v<std::size_t >(to_constant_expr (type.size ()));
191
+ const std::size_t array_size = numeric_cast_v<std::size_t >(mp_array_size);
191
192
192
193
array_exprt result (type);
193
194
result.reserve_operands (array_size);
You can’t perform that action at this time.
0 commit comments