@@ -415,7 +415,7 @@ void initialize_nondet_string_fields(
415
415
namespacet ns (symbol_table);
416
416
417
417
const struct_typet &struct_type =
418
- to_struct_type ( ns.follow (struct_expr.type ()));
418
+ ns.follow_tag ( to_struct_tag_type (struct_expr.type ()));
419
419
420
420
// In case the type for String was not added to the symbol table,
421
421
// (typically when string refinement is not activated), `struct_type`
@@ -541,7 +541,8 @@ void java_object_factoryt::gen_nondet_pointer_init(
541
541
generic_parameter_specialization_map_keys (
542
542
generic_parameter_specialization_map);
543
543
generic_parameter_specialization_map_keys.insert_pairs_for_pointer (
544
- replacement_pointer_type, ns.follow (replacement_pointer_type.subtype ()));
544
+ replacement_pointer_type,
545
+ ns.follow (to_struct_tag_type (replacement_pointer_type.subtype ())));
545
546
546
547
const symbol_exprt real_pointer_symbol = gen_nondet_subtype_pointer_init (
547
548
assignments, lifetime, replacement_pointer_type, depth, location);
@@ -570,7 +571,7 @@ void java_object_factoryt::gen_nondet_pointer_init(
570
571
// When we visit for 2nd time a type AND the maximum depth is exceeded, we set
571
572
// the pointer to NULL instead of recursively initializing the struct to which
572
573
// it points.
573
- const typet &subtype= ns.follow (pointer_type.subtype ());
574
+ const typet &subtype = ns.follow (to_struct_tag_type ( pointer_type.subtype () ));
574
575
if (subtype.id ()==ID_struct)
575
576
{
576
577
const struct_typet &struct_type=to_struct_type (subtype);
@@ -831,7 +832,7 @@ void java_object_factoryt::gen_nondet_struct_init(
831
832
const update_in_placet &update_in_place,
832
833
const source_locationt &location)
833
834
{
834
- PRECONDITION (ns. follow ( expr.type ()) .id ()==ID_struct );
835
+ PRECONDITION (expr.type ().id () == ID_struct_tag );
835
836
PRECONDITION (struct_type.id ()==ID_struct);
836
837
837
838
typedef struct_typet::componentst componentst;
@@ -1044,7 +1045,7 @@ void java_object_factoryt::gen_nondet_init(
1044
1045
generic_parameter_specialization_map_keys (
1045
1046
generic_parameter_specialization_map);
1046
1047
generic_parameter_specialization_map_keys.insert_pairs_for_pointer (
1047
- pointer_type, ns.follow ( pointer_type.subtype ()));
1048
+ pointer_type, ns.follow_tag ( to_struct_tag_type ( pointer_type.subtype () )));
1048
1049
1049
1050
gen_nondet_pointer_init (
1050
1051
assignments,
@@ -1055,23 +1056,23 @@ void java_object_factoryt::gen_nondet_init(
1055
1056
update_in_place,
1056
1057
location);
1057
1058
}
1058
- else if (type.id ()==ID_struct )
1059
+ else if (type.id () == ID_struct_tag )
1059
1060
{
1060
- const struct_typet struct_type=to_struct_type (type);
1061
+ const struct_tag_typet &struct_tag_type = to_struct_tag_type (type);
1062
+
1063
+ const struct_typet &struct_type = ns.follow_tag (struct_tag_type);
1061
1064
1062
1065
// If we are about to initialize a generic class (as a superclass object
1063
1066
// for a different object), add its concrete types to the map and delete
1064
1067
// them on leaving this function scope.
1065
1068
generic_parameter_specialization_map_keyst
1066
1069
generic_parameter_specialization_map_keys (
1067
1070
generic_parameter_specialization_map);
1071
+
1068
1072
if (is_sub)
1069
1073
{
1070
- const typet &symbol =
1071
- override_type.has_value () ? *override_type : expr.type ();
1072
- PRECONDITION (symbol.id () == ID_struct_tag);
1073
1074
generic_parameter_specialization_map_keys.insert_pairs_for_symbol (
1074
- to_struct_tag_type (symbol) , struct_type);
1075
+ struct_tag_type , struct_type);
1075
1076
}
1076
1077
1077
1078
gen_nondet_struct_init (
@@ -1392,8 +1393,9 @@ void java_object_factoryt::gen_nondet_array_init(
1392
1393
PRECONDITION (expr.type ().subtype ().id () == ID_struct_tag);
1393
1394
PRECONDITION (update_in_place != update_in_placet::MAY_UPDATE_IN_PLACE);
1394
1395
1395
- const typet &type = ns.follow (expr.type ().subtype ());
1396
- const struct_typet &struct_type = to_struct_type (type);
1396
+ const struct_tag_typet &struct_tag_type =
1397
+ to_struct_tag_type (expr.type ().subtype ());
1398
+ const struct_typet &struct_type = ns.follow_tag (struct_tag_type);
1397
1399
const typet &element_type =
1398
1400
static_cast <const typet &>(expr.type ().subtype ().find (ID_element_type));
1399
1401
@@ -1476,7 +1478,8 @@ void java_object_factoryt::gen_nondet_enum_init(
1476
1478
1477
1479
// Access members (length and data) of $VALUES array
1478
1480
dereference_exprt deref_expr (values.symbol_expr ());
1479
- const auto &deref_struct_type = to_struct_type (ns.follow (deref_expr.type ()));
1481
+ const auto &deref_struct_type =
1482
+ ns.follow_tag (to_struct_tag_type (deref_expr.type ()));
1480
1483
PRECONDITION (is_valid_java_array (deref_struct_type));
1481
1484
const auto &comps = deref_struct_type.components ();
1482
1485
const member_exprt length_expr (deref_expr, " length" , comps[1 ].type ());
0 commit comments