comparison src/share/vm/classfile/classFileParser.cpp @ 18104:eaf39a954227

Merge with jdk8u25-b17
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 16 Oct 2014 11:57:39 +0200
parents 52b4284cb496 ccfff14361ea
children b6d8deed3fd5
comparison
equal deleted inserted replaced
18044:42de29c9ffbc 18104:eaf39a954227
2784 2784
2785 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) { 2785 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) {
2786 ClassFileStream* cfs = stream(); 2786 ClassFileStream* cfs = stream();
2787 u1* current_start = cfs->current(); 2787 u1* current_start = cfs->current();
2788 2788
2789 guarantee_property(attribute_byte_length > sizeof(u2),
2790 "Invalid BootstrapMethods attribute length %u in class file %s",
2791 attribute_byte_length,
2792 CHECK);
2793
2794 cfs->guarantee_more(attribute_byte_length, CHECK); 2789 cfs->guarantee_more(attribute_byte_length, CHECK);
2795 2790
2796 int attribute_array_length = cfs->get_u2_fast(); 2791 int attribute_array_length = cfs->get_u2_fast();
2797 2792
2798 guarantee_property(_max_bootstrap_specifier_index < attribute_array_length, 2793 guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
2835 valid_cp_range(bootstrap_method_index, cp_size) && 2830 valid_cp_range(bootstrap_method_index, cp_size) &&
2836 _cp->tag_at(bootstrap_method_index).is_method_handle(), 2831 _cp->tag_at(bootstrap_method_index).is_method_handle(),
2837 "bootstrap_method_index %u has bad constant type in class file %s", 2832 "bootstrap_method_index %u has bad constant type in class file %s",
2838 bootstrap_method_index, 2833 bootstrap_method_index,
2839 CHECK); 2834 CHECK);
2835
2836 guarantee_property((operand_fill_index + 1 + argument_count) < operands->length(),
2837 "Invalid BootstrapMethods num_bootstrap_methods or num_bootstrap_arguments value in class file %s",
2838 CHECK);
2839
2840 operands->at_put(operand_fill_index++, bootstrap_method_index); 2840 operands->at_put(operand_fill_index++, bootstrap_method_index);
2841 operands->at_put(operand_fill_index++, argument_count); 2841 operands->at_put(operand_fill_index++, argument_count);
2842 2842
2843 cfs->guarantee_more(sizeof(u2) * argument_count, CHECK); // argv[argc] 2843 cfs->guarantee_more(sizeof(u2) * argument_count, CHECK); // argv[argc]
2844 for (int j = 0; j < argument_count; j++) { 2844 for (int j = 0; j < argument_count; j++) {
2852 operands->at_put(operand_fill_index++, argument_index); 2852 operands->at_put(operand_fill_index++, argument_index);
2853 } 2853 }
2854 } 2854 }
2855 2855
2856 assert(operand_fill_index == operands->length(), "exact fill"); 2856 assert(operand_fill_index == operands->length(), "exact fill");
2857 assert(ConstantPool::operand_array_length(operands) == attribute_array_length, "correct decode");
2858 2857
2859 u1* current_end = cfs->current(); 2858 u1* current_end = cfs->current();
2860 guarantee_property(current_end == current_start + attribute_byte_length, 2859 guarantee_property(current_end == current_start + attribute_byte_length,
2861 "Bad length on BootstrapMethods in class file %s", 2860 "Bad length on BootstrapMethods in class file %s",
2862 CHECK); 2861 CHECK);