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]

Patch: gcj fix for PR 5913


This patch fixes PR java/5913.

There's already a test case in the tree.  I'll disable the xfail for
it once this is approved.

In patch_binop there is a comment indicating that OP1_TYPE can be NULL
for INSTANCEOF_EXPR and a couple other cases.  The other cases handle
it correctly, in one case by calling patch_string.

I rebuilt libgcj on x86 with this patch.  I also ran the test suite
with no regressions.

Ok to commit?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	Fix for PR java/5913:
	* parse.y (patch_binop): Call patch_string on op1.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.377
diff -u -r1.377 parse.y
--- parse.y 7 May 2002 18:42:50 -0000 1.377
+++ parse.y 8 May 2002 04:52:58 -0000
@@ -13497,6 +13514,15 @@
     case INSTANCEOF_EXPR:
 
       TREE_TYPE (node) = boolean_type_node;
+
+      /* OP1_TYPE might be NULL when OP1 is a string constant.  */
+      if ((cn = patch_string (op1))) 
+	{
+	  op1 = cn;
+	  op1_type = TREE_TYPE (op1);
+	}
+      if (op1_type == NULL_TREE)
+	abort ();
 
       if (!(op2_type = resolve_type_during_patch (op2)))
 	return error_mark_node;


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