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]

Re: Patch for PR gcj/268


>> Here is an updated version of my patch for PR gcj/268.  I'm still
>> not convinced this is the correct patch, and it does feel rather
>> hacky to me.

Alex> Alternatively, one could build a WFL around it.

Works for me.  How about this patch?

2000-06-25  Tom Tromey  <tromey@cygnus.com>

	* parse.y (for_statement): Wrap expression in a WFL if it is a
	constant.  For PR gcj/268.

Tom

Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.181
diff -u -r1.181 parse.y
--- parse.y	2000/06/25 17:28:35	1.181
+++ parse.y	2000/06/25 22:30:33
@@ -1631,7 +1631,11 @@
 
 for_statement:
 	for_begin SC_TK expression SC_TK for_update CP_TK statement
-		{ $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7); }
+		{
+		  if (TREE_CODE_CLASS (TREE_CODE ($3)) == 'c')
+		    $3 = build_wfl_node ($3);
+		  $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7);
+		}
 |	for_begin SC_TK SC_TK for_update CP_TK statement
 		{ 
 		  $$ = finish_for_loop (0, NULL_TREE, $4, $6);

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