# HG changeset patch # User apangin # Date 1279640502 25200 # Node ID a5c9d63a187d367489b38557f12fe7a07c660577 # Parent 920aa833fd168a19523e23f2577836128ae3bc7e 6964170: Verifier crashes Summary: Check if klassOop != NULL rather than klass_part != NULL Reviewed-by: kamg, never diff -r 920aa833fd16 -r a5c9d63a187d src/share/vm/classfile/verificationType.cpp --- a/src/share/vm/classfile/verificationType.cpp Sat Jul 17 21:49:23 2010 -0700 +++ b/src/share/vm/classfile/verificationType.cpp Tue Jul 20 08:41:42 2010 -0700 @@ -70,7 +70,9 @@ } else if (is_array() && from.is_array()) { VerificationType comp_this = get_component(CHECK_false); VerificationType comp_from = from.get_component(CHECK_false); - return comp_this.is_assignable_from(comp_from, context, CHECK_false); + if (!comp_this.is_bogus() && !comp_from.is_bogus()) { + return comp_this.is_assignable_from(comp_from, context, CHECK_false); + } } return false; } @@ -98,7 +100,7 @@ CHECK_(VerificationType::bogus_type())); return VerificationType::reference_type(component); default: - ShouldNotReachHere(); + // Met an invalid type signature, e.g. [X return VerificationType::bogus_type(); } } diff -r 920aa833fd16 -r a5c9d63a187d src/share/vm/classfile/verifier.cpp --- a/src/share/vm/classfile/verifier.cpp Sat Jul 17 21:49:23 2010 -0700 +++ b/src/share/vm/classfile/verifier.cpp Tue Jul 20 08:41:42 2010 -0700 @@ -1847,12 +1847,8 @@ if (type == VerificationType::uninitialized_this_type()) { // The method must be an method of either this class, or one of its // superclasses - klassOop oop = current_class()(); - Klass* klass = oop->klass_part(); - while (klass != NULL && ref_class_type.name() != klass->name()) { - klass = klass->super()->klass_part(); - } - if (klass == NULL) { + if (ref_class_type.name() != current_class()->name() && + !name_in_supers(ref_class_type.name(), current_class())) { verify_error(bci, "Bad method call"); return; }