[PATCH] Java: fix for the PR #94.

Alexandre Petit-Bianco apbianco@cygnus.com
Tue Mar 7 16:30:00 GMT 2000


This patch fixes the Java PR #94:

  http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00125.html

I just committed it.

./A

2000-02-22  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (check_final_assignment): Extended to process
	COMPOUND_EXPR.
	(patch_assignment): Have check_final_assignment called only once.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.140
diff -u -p -r1.140 parse.y
--- parse.y	2000/03/07 22:09:56	1.140
+++ parse.y	2000/03/07 22:34:37
@@ -9081,6 +9081,10 @@ static int
 check_final_assignment (lvalue, wfl)
      tree lvalue, wfl;
 {
+  if (TREE_CODE (lvalue) == COMPOUND_EXPR 
+      && JDECL_P (TREE_OPERAND (lvalue, 1)))
+    lvalue = TREE_OPERAND (lvalue, 1);
+
   if (JDECL_P (lvalue) 
       && FIELD_FINAL (lvalue) && !IS_CLINIT (current_function_decl))
     {
@@ -9160,7 +9164,7 @@ patch_assignment (node, wfl_op1, wfl_op2
   else if (TREE_CODE (wfl_op1) == EXPR_WITH_FILE_LOCATION
 	   && resolve_expression_name (wfl_op1, &llvalue))
     {
-      if (check_final_assignment (llvalue, wfl_op1))
+      if (!error_found && check_final_assignment (llvalue, wfl_op1))
 	{
 	  /* What we should do instead is resetting the all the flags
 	     previously set, exchange lvalue for llvalue and continue. */



More information about the Gcc-patches mailing list