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]

[PATCH] Static variable assignment fix, printf format fix.


I checked in a fix to allow static variables accessed using a
qualified expression to be assigned to a value. Along with that patch
is a minor indentation and a bogus (%d instead of %s) printf format
fix.

Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (patch_bc_statement): Fixed identation and a bogus
 	`printf' format.

Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (patch_assignment): Allow static variables in other
 	classes to be assigned.

-- Alex

Index: parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/parse.y,v
retrieving revision 1.68
diff -u -p -r1.68 parse.y
--- parse.y	1999/03/27 16:17:13	1.68
+++ parse.y	1999/03/30 19:34:40
@@ -8568,13 +8568,17 @@ patch_assignment (node, wfl_op1, wfl_op2
   /* Otherwise, we might want to try to write into an optimized static
      final, this is an of a different nature, reported further on. */
   else if (TREE_CODE (wfl_op1) == EXPR_WITH_FILE_LOCATION
-	   && resolve_expression_name (wfl_op1, &llvalue)
-	   && check_final_assignment (llvalue, wfl_op1))
+	   && resolve_expression_name (wfl_op1, &llvalue))
     {
-      error_found = 1;
-      /* What we should do instead is resetting the all the flags
-         previously set, exchange lvalue for llvalue and continue. */
-      return error_mark_node;
+      if (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. */
+	  error_found = 1;
+	  return error_mark_node;
+	}
+      else 
+	lhs_type = TREE_TYPE (lvalue);
     }
   else 
     {
@@ -10670,9 +10674,9 @@ patch_bc_statement (node)
 		parse_error_context (wfl_operator,
 				     "`continue' must be in loop");
 	      else
-		parse_error_context (wfl_operator,
-				     "continue label `%d' does not name a loop",
-				     IDENTIFIER_POINTER (bc_label));
+		parse_error_context 
+		  (wfl_operator, "continue label `%s' does not name a loop",
+		   IDENTIFIER_POINTER (bc_label));
 	      return error_mark_node;
 	    }
 	  if ((DECL_NAME (LABELED_BLOCK_LABEL (labeled_block))


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