magic reflection access checks

Christian Thalinger twisti at complang.tuwien.ac.at
Tue Aug 21 15:19:56 PDT 2007


On Tue, 2007-08-21 at 15:10 -0700, Tom Rodriguez wrote:
> I agree that wasn't clear.  We are only loading these classes at this point so 
> the access checks are only performed for supers and interfaces.  Access checks 
> for those should always pass these tests, i.e we shouldn't be inheriting from 
> non public classes unless we are in the same package.

Yes, we are in the same package, but the classloader is different:

(gdb) p *cls->name
$3 = {hashlink = 0x0, blength = 35, text = 0xa40f60 "sun/reflect/ConstructorAccessorImpl"}
(gdb) p cls->classloader 
$4 = (classloader *) 0x0
(gdb) p *referer->name
$5 = {hashlink = 0xf6cf20, blength = 41, text = 0x10520d0 "sun/reflect/GeneratedConstructorAccessor1"}
(gdb) p referer->classloader 
$6 = (classloader *) 0x787c00

So the is_same_class_package-check can't be true.

- twisti



More information about the hotspot-dev mailing list