Patch: avoid crash with gcj -fno-assume-compiled

Tom Tromey tromey@redhat.com
Tue Jan 7 17:33:00 GMT 2003


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

Andrew> OK.  Last time I looked there were other bugs in that code
Andrew> too.

Indeed.

The appended fixes a crash that occurs if you try to have a compiled
subclass of an interpreted superclass.

I don't understand why this code is checking assume_compiled(...type_decl).
Perhaps that is simply an oversight and the `super' check should replace it
(instead of being added on)?

Ok for trunk?  This helps when trying to compile Eclipse...

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* class.c (make_class_data): Check that super is compiled before
	building class reference to it.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.143
diff -u -r1.143 class.c
--- class.c 7 Jan 2003 17:20:50 -0000 1.143
+++ class.c 7 Jan 2003 17:22:42 -0000
@@ -1556,7 +1556,8 @@
   super = CLASSTYPE_SUPER (type);
   if (super == NULL_TREE)
     super = null_pointer_node;
-  else if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl))))
+  else if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl)))
+	   && assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (super)))))
     super = build_class_ref (super);
   else
     {



More information about the Gcc-patches mailing list