re GNATS gcj/140 (gcj permits assignment to array length)
Fix for PR gcj/140: * parse.y (check_final_assignment): Recognize assignments to the `length' field of an array when generating class files. From-SVN: r32960
This commit is contained in:
parent
16d53b6439
commit
bc2874c902
|
@ -1,3 +1,9 @@
|
|||
2000-04-05 Tom Tromey <tromey@cygnus.com>
|
||||
|
||||
Fix for PR gcj/140:
|
||||
* parse.y (check_final_assignment): Recognize assignments to the
|
||||
`length' field of an array when generating class files.
|
||||
|
||||
2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
|
||||
|
||||
* class.c (decl_hash): Prototype removed.
|
||||
|
|
|
@ -14053,10 +14053,16 @@ check_final_assignment (lvalue, wfl)
|
|||
&& JDECL_P (TREE_OPERAND (lvalue, 1)))
|
||||
lvalue = TREE_OPERAND (lvalue, 1);
|
||||
|
||||
if (TREE_CODE (lvalue) == FIELD_DECL
|
||||
&& FIELD_FINAL (lvalue)
|
||||
&& !DECL_CLINIT_P (current_function_decl)
|
||||
&& !DECL_FINIT_P (current_function_decl))
|
||||
/* When generating class files, references to the `length' field
|
||||
look a bit different. */
|
||||
if ((flag_emit_class_files
|
||||
&& TREE_CODE (lvalue) == COMPONENT_REF
|
||||
&& TYPE_ARRAY_P (TREE_TYPE (TREE_OPERAND (lvalue, 0)))
|
||||
&& FIELD_FINAL (TREE_OPERAND (lvalue, 1)))
|
||||
|| (TREE_CODE (lvalue) == FIELD_DECL
|
||||
&& FIELD_FINAL (lvalue)
|
||||
&& !DECL_CLINIT_P (current_function_decl)
|
||||
&& !DECL_FINIT_P (current_function_decl)))
|
||||
{
|
||||
parse_error_context
|
||||
(wfl, "Can't assign a value to the final variable `%s'",
|
||||
|
|
|
@ -11421,10 +11421,16 @@ check_final_assignment (lvalue, wfl)
|
|||
&& JDECL_P (TREE_OPERAND (lvalue, 1)))
|
||||
lvalue = TREE_OPERAND (lvalue, 1);
|
||||
|
||||
if (TREE_CODE (lvalue) == FIELD_DECL
|
||||
&& FIELD_FINAL (lvalue)
|
||||
&& !DECL_CLINIT_P (current_function_decl)
|
||||
&& !DECL_FINIT_P (current_function_decl))
|
||||
/* When generating class files, references to the `length' field
|
||||
look a bit different. */
|
||||
if ((flag_emit_class_files
|
||||
&& TREE_CODE (lvalue) == COMPONENT_REF
|
||||
&& TYPE_ARRAY_P (TREE_TYPE (TREE_OPERAND (lvalue, 0)))
|
||||
&& FIELD_FINAL (TREE_OPERAND (lvalue, 1)))
|
||||
|| (TREE_CODE (lvalue) == FIELD_DECL
|
||||
&& FIELD_FINAL (lvalue)
|
||||
&& !DECL_CLINIT_P (current_function_decl)
|
||||
&& !DECL_FINIT_P (current_function_decl)))
|
||||
{
|
||||
parse_error_context
|
||||
(wfl, "Can't assign a value to the final variable `%s'",
|
||||
|
|
Loading…
Reference in New Issue