Skip to content

Commit ea3a21f

Browse files
author
Daniel Kroening
authored
Merge pull request #492 from mgudemann/java_parse_abstract_class_attribute
read ACC_ABSTRACT attribute in Java class files
2 parents 53d89b1 + 009ec58 commit ea3a21f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/java_bytecode/java_bytecode_parse_tree.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ void java_bytecode_parse_treet::classt::swap(
3434
{
3535
other.name.swap(name);
3636
other.extends.swap(extends);
37-
other.is_enum=is_enum;
38-
other.enum_elements=enum_elements;
37+
std::swap(other.is_enum, is_enum);
38+
std::swap(other.enum_elements, enum_elements);
3939
std::swap(other.is_abstract, is_abstract);
4040
other.implements.swap(implements);
4141
other.fields.swap(fields);

src/java_bytecode/java_bytecode_parse_tree.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ class java_bytecode_parse_treet
166166
{
167167
public:
168168
irep_idt name, extends;
169-
bool is_abstract;
170-
bool is_enum;
169+
bool is_abstract=false;
170+
bool is_enum=false;
171171
size_t enum_elements=0;
172172

173173
typedef std::list<irep_idt> implementst;

src/java_bytecode/java_bytecode_parser.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ void java_bytecode_parsert::rClassFile()
300300
u2 this_class=read_u2();
301301
u2 super_class=read_u2();
302302

303+
parsed_class.is_abstract=(access_flags&ACC_ABSTRACT)!=0;
303304
parsed_class.is_enum=(access_flags&ACC_ENUM)!=0;
304305
parsed_class.name=
305306
constant(this_class).type().get(ID_C_base_name);

0 commit comments

Comments
 (0)