@@ -417,7 +417,7 @@ void initialize_nondet_string_fields(
417
417
namespacet ns (symbol_table);
418
418
419
419
const struct_typet &struct_type =
420
- to_struct_type ( ns.follow (struct_expr.type ()));
420
+ ns.follow_tag ( to_struct_tag_type (struct_expr.type ()));
421
421
422
422
// In case the type for String was not added to the symbol table,
423
423
// (typically when string refinement is not activated), `struct_type`
@@ -1036,9 +1036,7 @@ void java_object_factoryt::gen_nondet_init(
1036
1036
update_in_placet update_in_place,
1037
1037
const source_locationt &location)
1038
1038
{
1039
- const typet &type=
1040
- override_ ? ns.follow (override_type) : ns.follow (expr.type ());
1041
-
1039
+ const typet &type = override_ ? override_type : expr.type ();
1042
1040
1043
1041
if (type.id ()==ID_pointer)
1044
1042
{
@@ -1062,22 +1060,23 @@ void java_object_factoryt::gen_nondet_init(
1062
1060
update_in_place,
1063
1061
location);
1064
1062
}
1065
- else if (type.id ()==ID_struct )
1063
+ else if (type.id () == ID_struct_tag )
1066
1064
{
1067
- const struct_typet struct_type=to_struct_type (type);
1065
+ const struct_tag_typet &struct_tag_type = to_struct_tag_type (type);
1066
+
1067
+ const struct_typet &struct_type = ns.follow_tag (struct_tag_type);
1068
1068
1069
1069
// If we are about to initialize a generic class (as a superclass object
1070
1070
// for a different object), add its concrete types to the map and delete
1071
1071
// them on leaving this function scope.
1072
1072
generic_parameter_specialization_map_keyst
1073
1073
generic_parameter_specialization_map_keys (
1074
1074
generic_parameter_specialization_map);
1075
+
1075
1076
if (is_sub)
1076
1077
{
1077
- const typet &symbol = override_ ? override_type : expr.type ();
1078
- PRECONDITION (symbol.id () == ID_struct_tag);
1079
1078
generic_parameter_specialization_map_keys.insert_pairs_for_symbol (
1080
- to_struct_tag_type (symbol) , struct_type);
1079
+ struct_tag_type , struct_type);
1081
1080
}
1082
1081
1083
1082
gen_nondet_struct_init (
@@ -1400,8 +1399,9 @@ void java_object_factoryt::gen_nondet_array_init(
1400
1399
PRECONDITION (expr.type ().subtype ().id () == ID_struct_tag);
1401
1400
PRECONDITION (update_in_place != update_in_placet::MAY_UPDATE_IN_PLACE);
1402
1401
1403
- const typet &type = ns.follow (expr.type ().subtype ());
1404
- const struct_typet &struct_type = to_struct_type (type);
1402
+ const struct_tag_typet &struct_tag_type =
1403
+ to_struct_tag_type (expr.type ().subtype ());
1404
+ const struct_typet &struct_type = ns.follow_tag (struct_tag_type);
1405
1405
const typet &element_type =
1406
1406
static_cast <const typet &>(expr.type ().subtype ().find (ID_element_type));
1407
1407
@@ -1481,7 +1481,8 @@ void java_object_factoryt::gen_nondet_enum_init(
1481
1481
1482
1482
// Access members (length and data) of $VALUES array
1483
1483
dereference_exprt deref_expr (values.symbol_expr ());
1484
- const auto &deref_struct_type = to_struct_type (ns.follow (deref_expr.type ()));
1484
+ const auto &deref_struct_type =
1485
+ ns.follow_tag (to_struct_tag_type (deref_expr.type ()));
1485
1486
PRECONDITION (is_valid_java_array (deref_struct_type));
1486
1487
const auto &comps = deref_struct_type.components ();
1487
1488
const member_exprt length_expr (deref_expr, " length" , comps[1 ].type ());
0 commit comments