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

Patch: 3.3 fix for PR java/9695


This patch fixes PR java/9695.

The bug here is that compiling Classpath with gcj fails.  We don't see
this failure when compiling libgcj because Classpath compiles all the
files in one go, and libgcj does not.

do_resolve_class expects its `cl' argument to be an
EXPR_WITH_FILE_LOCATION.  The crash in question occurs because one
infrequently-executed code path will call do_resolve_class with a
plain class.  This fix works by wrapping the class before passing it
on.

Tested by compiling Classpath.  This also rebuilt libgcj correctly,
and passed the test suite, including Jacks and Mauve, with no
regressions.

Ok for 3.3 and trunk?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey at redhat dot com>

	PR java/9695:
	* class.c (maybe_layout_super_class): Always pass a WFL to
	do_resolve_class.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.153
diff -u -r1.153 class.c
--- class.c 20 Feb 2003 17:51:46 -0000 1.153
+++ class.c 28 Feb 2003 02:47:47 -0000
@@ -1726,8 +1726,19 @@
 	super_class = TREE_TYPE (super_class);
       else
 	{
+	  /* do_resolve_class expects an EXPR_WITH_FILE_LOCATION, so
+	     we give it one.  */
+	  tree this_wrap = NULL_TREE;
+
+	  if (this_class)
+	    {
+	      tree this_decl = TYPE_NAME (this_class);
+	      this_wrap = build_expr_wfl (this_class,
+					  DECL_SOURCE_FILE (this_decl),
+					  DECL_SOURCE_LINE (this_decl), 0);
+	    }
 	  super_class = do_resolve_class (NULL_TREE, /* FIXME? */
-					  super_class, NULL_TREE, this_class);
+					  super_class, NULL_TREE, this_wrap);
 	  if (!super_class)
 	    return NULL_TREE;	/* FIXME, NULL_TREE not checked by caller. */
 	  super_class = TREE_TYPE (super_class);


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