@@ -525,9 +525,10 @@ void value_set_fivrt::get_value_set_rec(
525
525
526
526
const typet &type=ns.follow (expr.op0 ().type ());
527
527
528
- assert (type.id ()==ID_array ||
529
- type.id ()==ID_incomplete_array ||
530
- type.id ()==" #REF#" );
528
+ DATA_INVARIANT (type.id ()==ID_array ||
529
+ type.id ()==ID_incomplete_array ||
530
+ type.id ()==" #REF#" ,
531
+ " operand 0 of index expression must be an array" );
531
532
532
533
get_value_set_rec (expr.op0 (), dest, " []" +suffix,
533
534
original_type, ns, recursion_set);
@@ -542,10 +543,11 @@ void value_set_fivrt::get_value_set_rec(
542
543
{
543
544
const typet &type=ns.follow (expr.op0 ().type ());
544
545
545
- assert (type.id ()==ID_struct ||
546
- type.id ()==ID_union ||
547
- type.id ()==ID_incomplete_struct ||
548
- type.id ()==ID_incomplete_union);
546
+ DATA_INVARIANT (type.id ()==ID_struct ||
547
+ type.id ()==ID_union ||
548
+ type.id ()==ID_incomplete_struct ||
549
+ type.id ()==ID_incomplete_union,
550
+ " operand 0 of member expression must be struct or union" );
549
551
550
552
const std::string &component_name=
551
553
expr.get_string (ID_component_name);
@@ -1427,9 +1429,10 @@ void value_set_fivrt::assign_rec(
1427
1429
1428
1430
const typet &type=ns.follow (lhs.op0 ().type ());
1429
1431
1430
- assert (type.id ()==ID_array ||
1431
- type.id ()==ID_incomplete_array ||
1432
- type.id ()==" #REF#" );
1432
+ DATA_INVARIANT (type.id ()==ID_array ||
1433
+ type.id ()==ID_incomplete_array ||
1434
+ type.id ()==" #REF#" ,
1435
+ " operand 0 of index expression must be an array" );
1433
1436
1434
1437
assign_rec (
1435
1438
lhs.op0 (), values_rhs, " []" +suffix, ns, recursion_set, add_to_sets);
@@ -1446,10 +1449,11 @@ void value_set_fivrt::assign_rec(
1446
1449
1447
1450
const typet &type=ns.follow (lhs.op0 ().type ());
1448
1451
1449
- assert (type.id ()==ID_struct ||
1450
- type.id ()==ID_union ||
1451
- type.id ()==ID_incomplete_struct ||
1452
- type.id ()==ID_incomplete_union);
1452
+ DATA_INVARIANT (type.id ()==ID_struct ||
1453
+ type.id ()==ID_union ||
1454
+ type.id ()==ID_incomplete_struct ||
1455
+ type.id ()==ID_incomplete_union,
1456
+ " operand 0 of member expression must be struct or union" );
1453
1457
1454
1458
assign_rec (lhs.op0 (), values_rhs, " ." +component_name+suffix,
1455
1459
ns, recursion_set, add_to_sets);
0 commit comments