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


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

[PATCH] Fix for java/3635, CRCalc.



This fixes two reported problems:

  http://gcc.gnu.org/ml/java-prs/2001-q3/msg00018.html
  http://gcc.gnu.org/ml/java/2001-03/msg00246.html

It's been tested on x86/linux. I'm also adding two test cases:

  http://gcc.gnu.org/ml/java-patches/2001-q3/msg00061.html

I'm checking this in.

./A

2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (patch_method_invocation): Don't override primary if one
	is already provided, but let this$<n> be built. Fixed comment.

2001-07-12  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (empty_statement:): Report empty statement error only
	when found at class declaration level.
	Fixes PR java/3635

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.295
diff -u -p -r1.295 parse.y
--- parse.y	2001/07/12 21:36:43	1.295
+++ parse.y	2001/07/13 19:36:39
@@ -1453,7 +1453,13 @@ statement_without_trailing_substatement:
 empty_statement:
 	SC_TK
 		{ 
-		  if (flag_extraneous_semicolon)
+		  if (flag_extraneous_semicolon 
+		      && ! current_static_block 
+		      && (! current_function_decl || 
+			  /* Verify we're not in a inner class declaration */
+			  (GET_CPC () != TYPE_NAME
+			   (DECL_CONTEXT (current_function_decl)))))
+			   
 		    {
 		      EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1);
 		      parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used");
@@ -10030,7 +10036,7 @@ patch_method_invocation (patch, primary,
 	     - LIST is non static. It's invocation is transformed from
 	       x(a1,....,an) into access$<n>(this$<n>,a1,...,an).
 	     - LIST is static. It's invocation is transformed from
-	       x(a1,....,an) into TYPEOF(this$<n>).x(a1,....an).
+	       x(a1,....,an) into TYPE_OF(this$<n>).x(a1,....an).
 
 	     Of course, this$<n> can be abitrary complex, ranging from
 	     this$0 (the immediate outer context) to 
@@ -10040,7 +10046,8 @@ patch_method_invocation (patch, primary,
 	     this_arg has to be moved into the (then generated) stub
 	     argument list. In the meantime, the selected function
 	     might have be replaced by a generated stub. */
-	  if (maybe_use_access_method (is_super_init, &list, &this_arg))
+	  if (!primary &&
+	      maybe_use_access_method (is_super_init, &list, &this_arg))
 	    {
 	      args = tree_cons (NULL_TREE, this_arg, args);
 	      this_arg = NULL_TREE; /* So it doesn't get chained twice */


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