File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 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(
119119 INVARIANT (
120120 is_java_generic_inst_parameter (param),
121121 " 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+ }
123140 }
124141
125142 new_tag_buffer << " >" ;
Original file line number Diff line number Diff line change 2121
2222bool java_is_array_type (const typet &type)
2323{
24- if (type.id ()!= ID_struct)
24+ if (type.id () != ID_struct)
2525 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 ());
2927}
3028
3129unsigned java_local_variable_slots (const typet &t)
You can’t perform that action at this time.
0 commit comments