diff --git a/src/share/vm/classfile/verifier.cpp b/src/share/vm/classfile/verifier.cpp index 4a1adc5d705143af5dccd5ab1caf2907b682c796..17911273888a3633e6ef4a4f2b10a351dbf2e8b3 100644 --- a/src/share/vm/classfile/verifier.cpp +++ b/src/share/vm/classfile/verifier.cpp @@ -2310,21 +2310,19 @@ void ClassVerifier::verify_invoke_init( Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( vmSymbols::object_initializer_name(), cp->signature_ref_at(bcs->get_index_u2()), Klass::normal); - if (m == NULL) { - verify_error(ErrorContext::bad_code(bci), - "Call to missing method"); - return; - } - instanceKlassHandle mh(THREAD, m->method_holder()); - if (m->is_protected() && !mh->is_same_class_package(_klass())) { - bool assignable = current_type().is_assignable_from( - objectref_type, this, CHECK_VERIFY(this)); - if (!assignable) { - verify_error(ErrorContext::bad_type(bci, - TypeOrigin::cp(new_class_index, objectref_type), - TypeOrigin::implicit(current_type())), - "Bad access to protected method"); - return; + // Do nothing if method is not found. Let resolution detect the error. + if (m != NULL) { + instanceKlassHandle mh(THREAD, m->method_holder()); + if (m->is_protected() && !mh->is_same_class_package(_klass())) { + bool assignable = current_type().is_assignable_from( + objectref_type, this, CHECK_VERIFY(this)); + if (!assignable) { + verify_error(ErrorContext::bad_type(bci, + TypeOrigin::cp(new_class_index, objectref_type), + TypeOrigin::implicit(current_type())), + "Bad access to protected method"); + return; + } } } }