提交 8e423f31 编写于 作者: H hseigel

8043454: Test case for 8037157 should not throw a VerifyError

Summary: Don't throw VerifyError if method is NULL.
Reviewed-by: acorn, lfoltan, mschoene
上级 065aff1a
...@@ -2307,11 +2307,8 @@ void ClassVerifier::verify_invoke_init( ...@@ -2307,11 +2307,8 @@ void ClassVerifier::verify_invoke_init(
Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
vmSymbols::object_initializer_name(), vmSymbols::object_initializer_name(),
cp->signature_ref_at(bcs->get_index_u2())); cp->signature_ref_at(bcs->get_index_u2()));
if (m == NULL) { // Do nothing if method is not found. Let resolution detect the error.
verify_error(ErrorContext::bad_code(bci), if (m != NULL) {
"Call to missing <init> method");
return;
}
instanceKlassHandle mh(THREAD, m->method_holder()); instanceKlassHandle mh(THREAD, m->method_holder());
if (m->is_protected() && !mh->is_same_class_package(_klass())) { if (m->is_protected() && !mh->is_same_class_package(_klass())) {
bool assignable = current_type().is_assignable_from( bool assignable = current_type().is_assignable_from(
...@@ -2325,6 +2322,7 @@ void ClassVerifier::verify_invoke_init( ...@@ -2325,6 +2322,7 @@ void ClassVerifier::verify_invoke_init(
} }
} }
} }
}
current_frame->initialize_object(type, new_class_type); current_frame->initialize_object(type, new_class_type);
} else { } else {
verify_error(ErrorContext::bad_type(bci, current_frame->stack_top_ctx()), verify_error(ErrorContext::bad_type(bci, current_frame->stack_top_ctx()),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册