hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 25325 e3af4e02b0d5
parent 25066 57d8cb758cf8
child 25326 85b2f2e63e3e
equal deleted inserted replaced
25069:c937c5e883c5 25325:e3af4e02b0d5
   508   // but not yet to the other entries
   508   // but not yet to the other entries
   509   for (index = 1; index < length; index++) {
   509   for (index = 1; index < length; index++) {
   510     jbyte tag = cp->tag_at(index).value();
   510     jbyte tag = cp->tag_at(index).value();
   511     switch (tag) {
   511     switch (tag) {
   512       case JVM_CONSTANT_UnresolvedClass: {
   512       case JVM_CONSTANT_UnresolvedClass: {
   513         Symbol*  class_name = cp->unresolved_klass_at(index);
   513         Symbol*  class_name = cp->klass_name_at(index);
   514         // check the name, even if _cp_patches will overwrite it
   514         // check the name, even if _cp_patches will overwrite it
   515         verify_legal_class_name(class_name, CHECK_(nullHandle));
   515         verify_legal_class_name(class_name, CHECK_(nullHandle));
   516         break;
   516         break;
   517       }
   517       }
   518       case JVM_CONSTANT_NameAndType: {
   518       case JVM_CONSTANT_NameAndType: {
  3159     if (_cp->tag_at(super_class_index).is_klass()) {
  3159     if (_cp->tag_at(super_class_index).is_klass()) {
  3160       super_klass = instanceKlassHandle(THREAD, _cp->resolved_klass_at(super_class_index));
  3160       super_klass = instanceKlassHandle(THREAD, _cp->resolved_klass_at(super_class_index));
  3161       if (_need_verify)
  3161       if (_need_verify)
  3162         is_array = super_klass->oop_is_array();
  3162         is_array = super_klass->oop_is_array();
  3163     } else if (_need_verify) {
  3163     } else if (_need_verify) {
  3164       is_array = (_cp->unresolved_klass_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
  3164       is_array = (_cp->klass_name_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
  3165     }
  3165     }
  3166     if (_need_verify) {
  3166     if (_need_verify) {
  3167       guarantee_property(!is_array,
  3167       guarantee_property(!is_array,
  3168                         "Bad superclass name in class file %s", CHECK_NULL);
  3168                         "Bad superclass name in class file %s", CHECK_NULL);
  3169     }
  3169     }
  3853     valid_cp_range(this_class_index, cp_size) &&
  3853     valid_cp_range(this_class_index, cp_size) &&
  3854       cp->tag_at(this_class_index).is_unresolved_klass(),
  3854       cp->tag_at(this_class_index).is_unresolved_klass(),
  3855     "Invalid this class index %u in constant pool in class file %s",
  3855     "Invalid this class index %u in constant pool in class file %s",
  3856     this_class_index, CHECK_(nullHandle));
  3856     this_class_index, CHECK_(nullHandle));
  3857 
  3857 
  3858   Symbol*  class_name  = cp->unresolved_klass_at(this_class_index);
  3858   Symbol*  class_name  = cp->klass_name_at(this_class_index);
  3859   assert(class_name != NULL, "class_name can't be null");
  3859   assert(class_name != NULL, "class_name can't be null");
  3860 
  3860 
  3861   // It's important to set parsed_name *before* resolving the super class.
  3861   // It's important to set parsed_name *before* resolving the super class.
  3862   // (it's used for cleanup by the caller if parsing fails)
  3862   // (it's used for cleanup by the caller if parsing fails)
  3863   parsed_name = class_name;
  3863   parsed_name = class_name;