hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 25506 fb0b78b7bca6
parent 25470 4e69740b1547
child 25507 37c0bd9e16a0
equal deleted inserted replaced
25505:9bd829aeb960 25506:fb0b78b7bca6
  2796 
  2796 
  2797 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) {
  2797 void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_byte_length, TRAPS) {
  2798   ClassFileStream* cfs = stream();
  2798   ClassFileStream* cfs = stream();
  2799   u1* current_start = cfs->current();
  2799   u1* current_start = cfs->current();
  2800 
  2800 
  2801   cfs->guarantee_more(2, CHECK);  // length
       
  2802   int attribute_array_length = cfs->get_u2_fast();
       
  2803 
       
  2804   guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
       
  2805                      "Short length on BootstrapMethods in class file %s",
       
  2806                      CHECK);
       
  2807 
       
  2808   guarantee_property(attribute_byte_length >= sizeof(u2),
  2801   guarantee_property(attribute_byte_length >= sizeof(u2),
  2809                      "Invalid BootstrapMethods attribute length %u in class file %s",
  2802                      "Invalid BootstrapMethods attribute length %u in class file %s",
  2810                      attribute_byte_length,
  2803                      attribute_byte_length,
  2811                      CHECK);
  2804                      CHECK);
       
  2805 
       
  2806   cfs->guarantee_more(attribute_byte_length, CHECK);
       
  2807 
       
  2808   int attribute_array_length = cfs->get_u2_fast();
       
  2809 
       
  2810   guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
       
  2811                      "Short length on BootstrapMethods in class file %s",
       
  2812                      CHECK);
       
  2813 
  2812 
  2814 
  2813   // The attribute contains a counted array of counted tuples of shorts,
  2815   // The attribute contains a counted array of counted tuples of shorts,
  2814   // represending bootstrap specifiers:
  2816   // represending bootstrap specifiers:
  2815   //    length*{bootstrap_method_index, argument_count*{argument_index}}
  2817   //    length*{bootstrap_method_index, argument_count*{argument_index}}
  2816   int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2);
  2818   int operand_count = (attribute_byte_length - sizeof(u2)) / sizeof(u2);