8058575: IllegalAccessError trying to access package-private class from VM anonymous class

Put anonymous classes in unnamed package into host class's package.  Throw exception if host class's package differs from anonymous class.

Reviewed-by: coleenp, acorn
This commit is contained in:
Harold Seigel 2016-09-07 07:19:48 -04:00
parent c271d83599
commit e8e6415b7a
14 changed files with 416 additions and 31 deletions

View file

@ -2786,7 +2786,7 @@ void ClassVerifier::verify_invoke_instructions(
// direct interface relative to the host class
have_imr_indirect = (have_imr_indirect &&
!is_same_or_direct_interface(
InstanceKlass::cast(current_class()->host_klass()),
current_class()->host_klass(),
host_klass_type, ref_class_type));
}
if (!subtype) {