File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,24 @@ irep_idt generate_java_generic_typet::build_generic_tag(
119
119
INVARIANT (
120
120
is_java_generic_inst_parameter (param),
121
121
" Only create full concretized generic types" );
122
- new_tag_buffer << param.subtype ().get (ID_identifier);
122
+ const irep_idt &id (id2string (param.subtype ().get (ID_identifier)));
123
+ new_tag_buffer << id2string (id);
124
+ if (is_java_array_tag (id))
125
+ {
126
+ const typet &element_type =
127
+ java_array_element_type (to_symbol_type (param.subtype ()));
128
+
129
+ // If this is an array of references then we will specialize its
130
+ // identifier using the type of the objects in the array. Else, there can
131
+ // be a problem with the same symbols for different instantiations using
132
+ // arrays with different types.
133
+ if (element_type.id () == ID_pointer)
134
+ {
135
+ const symbol_typet element_symbol =
136
+ to_symbol_type (element_type.subtype ());
137
+ new_tag_buffer << " of_" << id2string (element_symbol.get_identifier ());
138
+ }
139
+ }
123
140
}
124
141
125
142
new_tag_buffer << " >" ;
Original file line number Diff line number Diff line change 21
21
22
22
bool java_is_array_type (const typet &type)
23
23
{
24
- if (type.id ()!= ID_struct)
24
+ if (type.id () != ID_struct)
25
25
return false ;
26
- return has_prefix (id2string (
27
- to_struct_type (type).get_tag ()),
28
- " java::array[" );
26
+ return is_java_array_tag (to_struct_type (type).get_tag ());
29
27
}
30
28
31
29
unsigned java_local_variable_slots (const typet &t)
You can’t perform that action at this time.
0 commit comments