@@ -105,7 +105,7 @@ void ci_lazy_methods_neededt::initialize_instantiated_classes_from_pointer(
105
105
// explore again even if we've seen this classid before in the array case.
106
106
if (add_needed_class (param_classid) || is_java_array_tag (param_classid))
107
107
{
108
- gather_field_types (pointer_type. subtype () , ns);
108
+ gather_field_types (class_type , ns);
109
109
}
110
110
111
111
if (is_java_generic_type (pointer_type))
@@ -126,31 +126,26 @@ void ci_lazy_methods_neededt::initialize_instantiated_classes_from_pointer(
126
126
// / \param class_type: root of class tree to search
127
127
// / \param ns: global namespaces.
128
128
void ci_lazy_methods_neededt::gather_field_types (
129
- const typet &class_type,
129
+ const struct_tag_typet &class_type,
130
130
const namespacet &ns)
131
131
{
132
- const auto &underlying_type = to_struct_type (ns.follow (class_type));
132
+ const auto &underlying_type = ns.follow_tag (class_type);
133
+
133
134
if (is_java_array_tag (underlying_type.get_tag ()))
134
135
{
135
- // If class_type is not a symbol this may be a reference array,
136
- // but we can't tell what type.
137
- if (class_type.id () == ID_struct_tag)
136
+ const typet &element_type = java_array_element_type (class_type);
137
+ if (element_type.id () == ID_pointer)
138
138
{
139
- const typet &element_type =
140
- java_array_element_type (to_struct_tag_type (class_type));
141
- if (element_type.id () == ID_pointer)
142
- {
143
- // This is a reference array -- mark its element type available.
144
- add_all_needed_classes (to_pointer_type (element_type));
145
- }
139
+ // This is a reference array -- mark its element type available.
140
+ add_all_needed_classes (to_pointer_type (element_type));
146
141
}
147
142
}
148
143
else
149
144
{
150
145
for (const auto &field : underlying_type.components ())
151
146
{
152
- if (field.type ().id () == ID_struct || field. type (). id () == ID_struct_tag)
153
- gather_field_types (field.type (), ns);
147
+ if (field.type ().id () == ID_struct_tag)
148
+ gather_field_types (to_struct_tag_type ( field.type () ), ns);
154
149
else if (field.type ().id () == ID_pointer)
155
150
{
156
151
if (field.type ().subtype ().id () == ID_struct_tag)
0 commit comments