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: PRs 1404 and 2332


I submitted this a while back and Alex approved it offline.
I'm finally checking it in.

I'm also putting it on the branch because this fix is needed to
compile the Apache javax.servlet code.  I think this code qualifies as
an important application.

2001-04-06  Tom Tromey  <tromey@redhat.com>
	    Alexandre Petit-Bianco  <apbianco@redhat.com>

	Fix for PR gcj/1404 and PR gcj/2332:
	* parse.y (build_array_from_name): If we use the type_wfl then
	accumulate dimensions from the original type as well.
	(build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.

Tom

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.16
diff -u -r1.251.2.16 parse.y
--- parse.y	2001/04/06 20:41:42	1.251.2.16
+++ parse.y	2001/04/07 19:51:45
@@ -3255,6 +3255,8 @@
   /* If we have, then craft a new type for this variable */
   if (more_dims)
     {
+      tree save = type;
+
       name = get_identifier (&string [more_dims]);
 
       /* If we have a pointer, use its type */
@@ -3273,7 +3275,14 @@
          is already an array on an unresolved type, and we just keep
          on adding dimensions) */
       else if (type_wfl)
-	type = type_wfl;
+	{
+	  int i = 0;
+	  type = type_wfl;
+	  string = IDENTIFIER_POINTER (TYPE_NAME (save));
+	  while (string[i]  == '[')
+	    ++i;
+	  more_dims += i;
+	}
 
       /* Add all the dimensions */
       while (more_dims--)
@@ -3313,8 +3322,10 @@
 		 IDENTIFIER_POINTER (EXPR_WFL_NODE (type_or_wfl)),
 		 IDENTIFIER_LENGTH (EXPR_WFL_NODE (type_or_wfl)));
   ptr = obstack_finish (&temporary_obstack);
-  EXPR_WFL_NODE (type_or_wfl) = get_identifier (ptr);
-  return type_or_wfl;
+  return build_expr_wfl (get_identifier (ptr),
+			 EXPR_WFL_FILENAME (type_or_wfl),
+			 EXPR_WFL_LINENO (type_or_wfl),
+			 EXPR_WFL_COLNO (type_or_wfl));
 }
 
 static void


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