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]
Other format: [Raw text]

Re: PR java/16927 [Was Re: PATCH for better assertion control.]


Disabling assertions caused an ICE if the body of the assertion was a
string concatenation.

Andrew.



2004-09-23  Andrew Haley  <aph@redhat.com>

	PR java/16927:
	* parse.y (java_complete_lhs): Call patch_string() on Operand 1 of
	COND_EXPRs.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.506
diff -p -2 -c -w -r1.506 parse.y
*** parse.y	22 Sep 2004 10:51:42 -0000	1.506
--- parse.y	23 Sep 2004 18:01:07 -0000
*************** java_complete_lhs (tree node)
*** 11648,11651 ****
--- 11648,11660 ----
        if (TREE_OPERAND (node, 1) == error_mark_node)
  	return error_mark_node;
+       {
+ 	/* This is a special case due to build_assertion().  When
+ 	   assertions are disabled we build a COND_EXPR in which
+ 	   Operand 1 is the body of the assertion.  If that happens to
+ 	   be a string concatenation we'll need to patch it here.  */
+ 	tree patched = patch_string (TREE_OPERAND (node, 1));
+ 	if (patched)
+ 	  TREE_OPERAND (node, 1) = patched;
+       }
       TREE_OPERAND (node, 2) = java_complete_tree (TREE_OPERAND (node, 2));
        if (TREE_OPERAND (node, 2) == error_mark_node)


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