[PATCH] Java: Parser and CheckArrayStore fixes

Alexandre Petit-Bianco apbianco@cygnus.com
Tue May 25 16:43:00 GMT 1999


I just checked in a patch to fix some parser bugs (floating point
literal parsing and a undersized local buffer used when parsing
`@deprecated') as well as an undesirable side effect occurring during
the generation of the CheckArrayStore operation.

./A

Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * parse.y (patch_assignment): Save the rhs before using it as an
        argument to _Jv_CheckArrayStore.
 
Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
 
Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
        floating point litteral only when the exponent indicator has been
        parsed.
 
Index: lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/lex.c,v
retrieving revision 1.30
diff -u -p -r1.30 lex.c
--- lex.c	1999/05/03 16:45:06	1.30
+++ lex.c	1999/05/25 23:30:59
@@ -427,7 +427,7 @@ java_parse_doc_section (c)
   /* We're parsing @deprecated */
   if (valid_tag && (c == '@'))
     {
-      char tag [10];
+      char tag [11];
       int  tag_index = 0;
 
       while (tag_index < 10 && c != UEOF && c != ' ' && c != '\n')
@@ -741,7 +741,7 @@ java_lex (java_lval)
 		  stage = 4;	/* So we fall through */
 		}
 
-	      if ((c=='-' || c =='+') && stage < 3)
+	      if ((c=='-' || c =='+') && stage == 2)
 		{
 		  stage = 3;
 		  literal_token [literal_index++] = c;
Index: parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/parse.y,v
retrieving revision 1.87
diff -u -p -r1.87 parse.y
--- parse.y	1999/05/22 14:38:13	1.87
+++ parse.y	1999/05/25 23:31:00
@@ -8847,6 +8847,7 @@ patch_assignment (node, wfl_op1, wfl_op2
 	}
 
       /* Build the invocation of _Jv_CheckArrayStore */
+      new_rhs = save_expr (new_rhs);
       check = build (CALL_EXPR, void_type_node,
 		     build_address_of (soft_checkarraystore_node),
 		     tree_cons (NULL_TREE, base,


More information about the Gcc-patches mailing list