mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8043454: Test case for 8037157 should not throw a VerifyError
Don't throw VerifyError if method is NULL. Reviewed-by: acorn, lfoltan, mschoene
This commit is contained in:
parent
2216f41ed6
commit
0cc38ff4d5
1 changed files with 13 additions and 15 deletions
|
@ -2311,21 +2311,19 @@ void ClassVerifier::verify_invoke_init(
|
||||||
vmSymbols::object_initializer_name(),
|
vmSymbols::object_initializer_name(),
|
||||||
cp->signature_ref_at(bcs->get_index_u2()),
|
cp->signature_ref_at(bcs->get_index_u2()),
|
||||||
Klass::normal);
|
Klass::normal);
|
||||||
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");
|
instanceKlassHandle mh(THREAD, m->method_holder());
|
||||||
return;
|
if (m->is_protected() && !mh->is_same_class_package(_klass())) {
|
||||||
}
|
bool assignable = current_type().is_assignable_from(
|
||||||
instanceKlassHandle mh(THREAD, m->method_holder());
|
objectref_type, this, CHECK_VERIFY(this));
|
||||||
if (m->is_protected() && !mh->is_same_class_package(_klass())) {
|
if (!assignable) {
|
||||||
bool assignable = current_type().is_assignable_from(
|
verify_error(ErrorContext::bad_type(bci,
|
||||||
objectref_type, this, CHECK_VERIFY(this));
|
TypeOrigin::cp(new_class_index, objectref_type),
|
||||||
if (!assignable) {
|
TypeOrigin::implicit(current_type())),
|
||||||
verify_error(ErrorContext::bad_type(bci,
|
"Bad access to protected <init> method");
|
||||||
TypeOrigin::cp(new_class_index, objectref_type),
|
return;
|
||||||
TypeOrigin::implicit(current_type())),
|
}
|
||||||
"Bad access to protected <init> method");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue