File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3445,8 +3445,8 @@ inline const with_exprt &to_with_expr(const exprt &expr)
3445
3445
{
3446
3446
PRECONDITION (expr.id ()==ID_with);
3447
3447
DATA_INVARIANT (
3448
- expr.operands ().size ()== 3 ,
3449
- " Array /structure update must have three operands" );
3448
+ expr.operands ().size () >= 3 && expr. operands (). size () % 2 == 1 ,
3449
+ " array /structure update must have at least three operands" );
3450
3450
return static_cast <const with_exprt &>(expr);
3451
3451
}
3452
3452
@@ -3455,8 +3455,8 @@ inline with_exprt &to_with_expr(exprt &expr)
3455
3455
{
3456
3456
PRECONDITION (expr.id ()==ID_with);
3457
3457
DATA_INVARIANT (
3458
- expr.operands ().size ()== 3 ,
3459
- " Array /structure update must have three operands" );
3458
+ expr.operands ().size () >= 3 && expr. operands (). size () % 2 == 1 ,
3459
+ " array /structure update must have at least three operands" );
3460
3460
return static_cast <with_exprt &>(expr);
3461
3461
}
3462
3462
@@ -3466,10 +3466,9 @@ template<> inline bool can_cast_expr<with_exprt>(const exprt &base)
3466
3466
}
3467
3467
inline void validate_expr (const with_exprt &value)
3468
3468
{
3469
- validate_operands (
3470
- value,
3471
- 3 ,
3472
- " Array/structure update must have three operands" );
3469
+ DATA_INVARIANT (
3470
+ value.operands ().size () % 2 == 1 ,
3471
+ " array/structure update must have an odd number of operands" );
3473
3472
}
3474
3473
3475
3474
class index_designatort : public expr_protectedt
You can’t perform that action at this time.
0 commit comments