@@ -1588,7 +1588,8 @@ void java_bytecode_parsert::relement_value_pair(
1588
1588
// / in its inner class array. If the parsed class is not an inner class, then it
1589
1589
// / is ignored. When a parsed class is an inner class, the accessibility
1590
1590
// / information for the parsed class is overwritten, and the parsed class is
1591
- // / marked as an inner class.
1591
+ // / marked as an inner class. Note that is outer_class_info_index == 0, the
1592
+ // / inner class is an anonymous or local class, and is treated as private.
1592
1593
void java_bytecode_parsert::rinner_classes_attribute (
1593
1594
classt &parsed_class,
1594
1595
const u4 &attribute_length)
@@ -1631,7 +1632,17 @@ void java_bytecode_parsert::rinner_classes_attribute(
1631
1632
parsed_class.is_inner_class =
1632
1633
remove_separator_char (id2string (parsed_class.name ), ' .' ) ==
1633
1634
remove_separator_char (inner_class_info_name, ' /' );
1634
- if (parsed_class.is_inner_class )
1635
+ if (!parsed_class.is_inner_class )
1636
+ continue ;
1637
+ if (outer_class_info_index == 0 )
1638
+ {
1639
+ // This is a marker for an anonymous or local class
1640
+ // which are treated as private
1641
+ parsed_class.is_private = true ;
1642
+ parsed_class.is_protected = false ;
1643
+ parsed_class.is_public = false ;
1644
+ }
1645
+ else
1635
1646
{
1636
1647
parsed_class.is_private = is_private;
1637
1648
parsed_class.is_protected = is_protected;
0 commit comments