[BC] Patch: FYI: access check without initialization

Bryce McKinlay mckinlay@redhat.com
Fri Sep 3 18:33:00 GMT 2004


Tom Tromey wrote:

>I'm checking this in on the BC branch.
>
>My previous patch didn't take into account that _Jv_CheckAccess will
>initialize classes.  This caused some problems when trying to run
>Eclipse.  Fixed as appended.
>
>	* prims.cc (_Jv_CheckAccessNoInit): New method.
>  
>
This is actually a bug in _Jv_CheckAccess. It shouldn't need to 
initialize classes, rather Class objects should always have their 
ancestors/interface tables linked by the time we call it. In this case, 
that should always be true, because _Jv_PrepareConstantTimeTables will 
be called before vtable layout.

It *should* be safe to instead change _Jv_CheckAccess to use 
_Jv_IsAssignableFrom (which doesnt initialize). If there are other cases 
where _Jv_CheckAccess could be called with a non-prepared class 
argument, they should be fixed.

Regards

Bryce



More information about the Java-patches mailing list