Skip to content

Commit d20a12e

Browse files
author
Matthias Güdemann
authored
Merge pull request #2517 from jeannielynnmoulton/jeannie/InnerStaticClasses
Captures static inner class information
2 parents 6409eae + fe73955 commit d20a12e

14 files changed

+136
-0
lines changed

jbmc/src/java_bytecode/java_bytecode_convert_class.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ void java_bytecode_convert_classt::convert(
277277
class_type.set(ID_synthetic, c.is_synthetic);
278278
class_type.set_final(c.is_final);
279279
class_type.set_is_inner_class(c.is_inner_class);
280+
class_type.set_is_static_class(c.is_static_class);
280281
if(c.is_enum)
281282
{
282283
if(max_array_length != 0 && c.enum_elements > max_array_length)

jbmc/src/java_bytecode/java_bytecode_parse_tree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class java_bytecode_parse_treet
218218
bool is_synthetic = false;
219219
bool is_annotation = false;
220220
bool is_inner_class = false;
221+
bool is_static_class = false;
221222
bool attribute_bootstrapmethods_read = false;
222223
size_t enum_elements=0;
223224

jbmc/src/java_bytecode/java_bytecode_parser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,7 @@ void java_bytecode_parsert::rinner_classes_attribute(
16221622
bool is_private = (inner_class_access_flags & ACC_PRIVATE) != 0;
16231623
bool is_public = (inner_class_access_flags & ACC_PUBLIC) != 0;
16241624
bool is_protected = (inner_class_access_flags & ACC_PROTECTED) != 0;
1625+
bool is_static = (inner_class_access_flags & ACC_STATIC) != 0;
16251626

16261627
// If the original parsed class name matches the inner class name,
16271628
// the parsed class is an inner class, so overwrite the parsed class'
@@ -1632,6 +1633,7 @@ void java_bytecode_parsert::rinner_classes_attribute(
16321633
parsed_class.is_inner_class = is_inner_class;
16331634
if(!is_inner_class)
16341635
continue;
1636+
parsed_class.is_static_class = is_static;
16351637
// Note that if outer_class_info_index == 0, the inner class is an anonymous
16361638
// or local class, and is treated as private.
16371639
if(outer_class_info_index == 0)

jbmc/src/java_bytecode/java_types.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ class java_class_typet:public class_typet
121121
return set(ID_is_inner_class, is_inner_class);
122122
}
123123

124+
const bool get_is_static_class() const
125+
{
126+
return get_bool(ID_is_static);
127+
}
128+
129+
void set_is_static_class(const bool &is_static_class)
130+
{
131+
return set(ID_is_static, is_static_class);
132+
}
133+
134+
124135
bool get_final()
125136
{
126137
return get_bool(ID_final);
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)