diff --git a/src/java_bytecode/java_bytecode_parse_tree.cpp b/src/java_bytecode/java_bytecode_parse_tree.cpp index e48675d275f..63fb5674f85 100644 --- a/src/java_bytecode/java_bytecode_parse_tree.cpp +++ b/src/java_bytecode/java_bytecode_parse_tree.cpp @@ -34,8 +34,8 @@ void java_bytecode_parse_treet::classt::swap( { other.name.swap(name); other.extends.swap(extends); - other.is_enum=is_enum; - other.enum_elements=enum_elements; + std::swap(other.is_enum, is_enum); + std::swap(other.enum_elements, enum_elements); std::swap(other.is_abstract, is_abstract); other.implements.swap(implements); other.fields.swap(fields); diff --git a/src/java_bytecode/java_bytecode_parse_tree.h b/src/java_bytecode/java_bytecode_parse_tree.h index bd62b0e1377..69e4aee7f1f 100644 --- a/src/java_bytecode/java_bytecode_parse_tree.h +++ b/src/java_bytecode/java_bytecode_parse_tree.h @@ -166,8 +166,8 @@ class java_bytecode_parse_treet { public: irep_idt name, extends; - bool is_abstract; - bool is_enum; + bool is_abstract=false; + bool is_enum=false; size_t enum_elements=0; typedef std::list implementst; diff --git a/src/java_bytecode/java_bytecode_parser.cpp b/src/java_bytecode/java_bytecode_parser.cpp index 323ef603af8..012a1c21dea 100644 --- a/src/java_bytecode/java_bytecode_parser.cpp +++ b/src/java_bytecode/java_bytecode_parser.cpp @@ -300,6 +300,7 @@ void java_bytecode_parsert::rClassFile() u2 this_class=read_u2(); u2 super_class=read_u2(); + parsed_class.is_abstract=(access_flags&ACC_ABSTRACT)!=0; parsed_class.is_enum=(access_flags&ACC_ENUM)!=0; parsed_class.name= constant(this_class).type().get(ID_C_base_name);