@@ -182,8 +182,10 @@ class java_bytecode_parsert final : public parsert
182
182
class structured_pool_entryt
183
183
{
184
184
public:
185
- explicit structured_pool_entryt (java_bytecode_parsert::pool_entryt entry)
186
- : tag(entry.tag)
185
+ using pool_entryt = java_bytecode_parsert::pool_entryt;
186
+ using pool_entry_lookupt = std::function<pool_entryt &(u2)>;
187
+
188
+ explicit structured_pool_entryt (pool_entryt entry) : tag(entry.tag)
187
189
{
188
190
}
189
191
@@ -192,10 +194,6 @@ class structured_pool_entryt
192
194
return tag;
193
195
}
194
196
195
- using pool_entry_lookupt =
196
- std::function<java_bytecode_parsert::pool_entryt &(u2)>;
197
- using pool_entryt = java_bytecode_parsert::pool_entryt;
198
-
199
197
protected:
200
198
static std::string read_utf8_constant (const pool_entryt &entry)
201
199
{
@@ -234,7 +232,7 @@ class class_infot : public structured_pool_entryt
234
232
class name_and_type_infot : public structured_pool_entryt
235
233
{
236
234
public:
237
- explicit name_and_type_infot (java_bytecode_parsert:: pool_entryt entry)
235
+ explicit name_and_type_infot (pool_entryt entry)
238
236
: structured_pool_entryt(entry)
239
237
{
240
238
PRECONDITION (entry.tag == CONSTANT_NameAndType);
@@ -323,7 +321,7 @@ class method_handle_infot : public structured_pool_entryt
323
321
REF_invokeInterface = 9
324
322
};
325
323
326
- explicit method_handle_infot (java_bytecode_parsert:: pool_entryt entry)
324
+ explicit method_handle_infot (pool_entryt entry)
327
325
: structured_pool_entryt(entry)
328
326
{
329
327
PRECONDITION (entry.tag == CONSTANT_MethodHandle);
@@ -588,15 +586,11 @@ void java_bytecode_parsert::get_class_refs_rec(const typet &src)
588
586
}
589
587
else if (src.id () == ID_struct_tag)
590
588
{
591
- irep_idt name=src.get (ID_C_base_name);
592
- if (has_prefix (id2string (name), " array[" ))
593
- {
594
- const typet &element_type =
595
- static_cast <const typet &>(src.find (ID_element_type));
596
- get_class_refs_rec (element_type);
597
- }
589
+ const struct_tag_typet &struct_tag_type = to_struct_tag_type (src);
590
+ if (is_java_array_tag (struct_tag_type.get_identifier ()))
591
+ get_class_refs_rec (java_array_element_type (struct_tag_type));
598
592
else
599
- parse_tree.class_refs .insert (name );
593
+ parse_tree.class_refs .insert (src. get (ID_C_base_name) );
600
594
}
601
595
else if (src.id ()==ID_struct)
602
596
{
@@ -1643,10 +1637,9 @@ void java_bytecode_parsert::rinner_classes_attribute(
1643
1637
// access information and mark it as an inner class.
1644
1638
bool is_inner_class = remove_separator_char (id2string (parsed_class.name ), ' .' ) ==
1645
1639
remove_separator_char (inner_class_info_name, ' /' );
1646
- if (is_inner_class)
1647
- parsed_class.is_inner_class = is_inner_class;
1648
1640
if (!is_inner_class)
1649
1641
continue ;
1642
+ parsed_class.is_inner_class = is_inner_class;
1650
1643
parsed_class.is_static_class = is_static;
1651
1644
// This is a marker that a class is anonymous.
1652
1645
if (inner_name_index == 0 )
0 commit comments