< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page

        

*** 3308,3318 **** cfs->guarantee_more(2, CHECK); // attributes_count u2 attributes_count = cfs->get_u2_fast(); bool parsed_sourcefile_attribute = false; bool parsed_innerclasses_attribute = false; bool parsed_nest_members_attribute = false; ! bool parsed_member_of_nest_attribute = false; bool parsed_enclosingmethod_attribute = false; bool parsed_bootstrap_methods_attribute = false; const u1* runtime_visible_annotations = NULL; int runtime_visible_annotations_length = 0; const u1* runtime_invisible_annotations = NULL; --- 3308,3318 ---- cfs->guarantee_more(2, CHECK); // attributes_count u2 attributes_count = cfs->get_u2_fast(); bool parsed_sourcefile_attribute = false; bool parsed_innerclasses_attribute = false; bool parsed_nest_members_attribute = false; ! bool parsed_nest_host_attribute = false; bool parsed_enclosingmethod_attribute = false; bool parsed_bootstrap_methods_attribute = false; const u1* runtime_visible_annotations = NULL; int runtime_visible_annotations_length = 0; const u1* runtime_invisible_annotations = NULL;
*** 3375,3406 **** if (parsed_nest_members_attribute) { classfile_parse_error("Multiple NestMembers attributes in class file %s", CHECK); } else { parsed_nest_members_attribute = true; } ! if (parsed_member_of_nest_attribute) { ! classfile_parse_error("Conflicting MemberOfNest and NestMembers attributes in class file %s", CHECK); } nest_members_attribute_start = cfs->current(); nest_members_attribute_length = attribute_length; cfs->skip_u1(nest_members_attribute_length, CHECK); ! } else if (tag == vmSymbols::tag_member_of_nest()) { ! if (parsed_member_of_nest_attribute) { ! classfile_parse_error("Multiple MemberOfNest attributes in class file %s", CHECK); } else { ! parsed_member_of_nest_attribute = true; } if (parsed_nest_members_attribute) { ! classfile_parse_error("Conflicting NestMembers and MemberOfNest attributes in class file %s", CHECK); } cfs->guarantee_more(2, CHECK); u2 class_info_index = cfs->get_u2_fast(); check_property( valid_klass_reference_at(class_info_index), ! "Nest top class_info_index %u has bad constant type in class file %s", class_info_index, CHECK); ! _nest_top = class_info_index; } else if (tag == vmSymbols::tag_synthetic()) { // Check for Synthetic tag // Shouldn't we check that the synthetic flags wasn't already set? - not required in spec if (attribute_length != 0) { classfile_parse_error( --- 3375,3406 ---- if (parsed_nest_members_attribute) { classfile_parse_error("Multiple NestMembers attributes in class file %s", CHECK); } else { parsed_nest_members_attribute = true; } ! if (parsed_nest_host_attribute) { ! classfile_parse_error("Conflicting NestHost and NestMembers attributes in class file %s", CHECK); } nest_members_attribute_start = cfs->current(); nest_members_attribute_length = attribute_length; cfs->skip_u1(nest_members_attribute_length, CHECK); ! } else if (tag == vmSymbols::tag_nest_host()) { ! if (parsed_nest_host_attribute) { ! classfile_parse_error("Multiple NestHost attributes in class file %s", CHECK); } else { ! parsed_nest_host_attribute = true; } if (parsed_nest_members_attribute) { ! classfile_parse_error("Conflicting NestMembers and NestHost attributes in class file %s", CHECK); } cfs->guarantee_more(2, CHECK); u2 class_info_index = cfs->get_u2_fast(); check_property( valid_klass_reference_at(class_info_index), ! "Nest-host class_info_index %u has bad constant type in class file %s", class_info_index, CHECK); ! _nest_host = class_info_index; } else if (tag == vmSymbols::tag_synthetic()) { // Check for Synthetic tag // Shouldn't we check that the synthetic flags wasn't already set? - not required in spec if (attribute_length != 0) { classfile_parse_error(
*** 3616,3626 **** this_klass->set_constants(_cp); this_klass->set_fields(_fields, java_fields_count); this_klass->set_methods(_methods); this_klass->set_inner_classes(_inner_classes); this_klass->set_nest_members(_nest_members); ! this_klass->set_nest_top_index(_nest_top); this_klass->set_local_interfaces(_local_interfaces); this_klass->set_transitive_interfaces(_transitive_interfaces); this_klass->set_annotations(_combined_annotations); // Clear out these fields so they don't get deallocated by the destructor --- 3616,3626 ---- this_klass->set_constants(_cp); this_klass->set_fields(_fields, java_fields_count); this_klass->set_methods(_methods); this_klass->set_inner_classes(_inner_classes); this_klass->set_nest_members(_nest_members); ! this_klass->set_nest_host_index(_nest_host); this_klass->set_local_interfaces(_local_interfaces); this_klass->set_transitive_interfaces(_transitive_interfaces); this_klass->set_annotations(_combined_annotations); // Clear out these fields so they don't get deallocated by the destructor
*** 5693,5703 **** _cp(NULL), _fields(NULL), _methods(NULL), _inner_classes(NULL), _nest_members(NULL), ! _nest_top(0), _local_interfaces(NULL), _transitive_interfaces(NULL), _combined_annotations(NULL), _annotations(NULL), _type_annotations(NULL), --- 5693,5703 ---- _cp(NULL), _fields(NULL), _methods(NULL), _inner_classes(NULL), _nest_members(NULL), ! _nest_host(0), _local_interfaces(NULL), _transitive_interfaces(NULL), _combined_annotations(NULL), _annotations(NULL), _type_annotations(NULL),
< prev index next >