This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR java/19277: Array.length++ is incorrectly allowed


Ranjit Mathew writes:

 > from  Ranjit Mathew  <rmathew@hotmail.com>
 > 
 > 	PR java/19277
 > 	* check-init.c (check_init): Take care of references that do not
 > 	have an explicit final variable declaration (e.g. array length
 > 	access) for pre/post in/de-crement operators.

OK.

 > 
 > Index: check-init.c
 > ===================================================================
 > --- check-init.c	2005-01-10 13:04:36.000000000 +0530
 > +++ check-init.c	2005-01-10 16:24:11.000000000 +0530
 > @@ -833,5 +833,11 @@ check_init (tree exp, words before)
 >        tmp = get_variable_decl (TREE_OPERAND (exp, 0));
 >        if (tmp != NULL_TREE && DECL_FINAL (tmp))
 > -	final_assign_error (DECL_NAME (tmp));      
 > +	final_assign_error (DECL_NAME (tmp));
 > +      else if (TREE_CODE (tmp = TREE_OPERAND (exp, 0)) == COMPONENT_REF)
 > +        {

Please add a small comment to say what this is for.
  Like '* Don't allow pre/post in/de-crement operators on final fields.  */

Thanks,
Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]