[Patch] PR java/9685: Fix Catching Illegal Access to Package-Private Fields/Members

Bryce McKinlay mckinlay@redhat.com
Wed Apr 21 15:42:00 GMT 2004


Ranjit Mathew wrote:

>    This patch proposes to fix PR java/9685.
>
>Tested on i686-pc-linux-gnu by bootstrapping c,c++,java.
>No testsuite regressions, except for the known
>InvokeInterface failure that's unrelated to this patch.
>
>Ok for mainline?
>  
>
Ranjit,

This patch looks good to me (see comments below), but Andrew or Per will 
have to approve it. Did you run it against the jacks testsuite? 
Hopefully it should fix some failures there.

>Notes:
>
>1. This still does not fix catching illegal accesses to
>   package-private *classes* - only fields/members. That
>   needs a separate patch.
>  
>

Could you file a separate PR for this case (if one doesn't exist already)?

>2. I chose to create a new function java_acc_ctrl_str
>   instead of using java_accstring_lookup, as the latter
>   does not return the desired string for package-private
>   access. It also returns "bogus" strings if static, etc.
>   is also flagged.
>  
>
It would be good to add a comment explaining this to java_acc_ctrl_str. 
Also it might be nice to have a less cryptic method name here - the 
front end is not afraid of long function names ;-) perhaps 
member_accessibility_string ?

Regards

Bryce



More information about the Gcc-patches mailing list