Patch: FYI: fix PR java/36247

Tom Tromey tromey@redhat.com
Sat Jun 14 20:26:00 GMT 2008


I'm checking this in on the trunk and the 4.3 branch.

This fixes PR java/36247, a regression when compiling a class with a
native method.  In 4.3 this started ICEing in some cases.

Bootstrapped and regtested on x86-64 (compile farm).

Tom

java/ChangeLog:
2008-06-14  Tom Tromey  <tromey@redhat.com>

	PR java/36247:
	* class.c (build_class_ref): Initialize this_classdollar when
	needed.

Index: java/class.c
===================================================================
--- java/class.c	(revision 136683)
+++ java/class.c	(working copy)
@@ -1,6 +1,6 @@
 /* Functions related to building classes and their related objects.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1148,7 +1148,13 @@
 	return build_indirect_class_ref (type);
 
       if (type == output_class && flag_indirect_classes)
-	return this_classdollar;
+	{
+	  /* This can be NULL if we see a JNI stub before we see any
+	     other method.  */
+	  if (! this_classdollar)
+	    this_classdollar = build_classdollar_field (output_class);
+	  return this_classdollar;
+	}
       
       if (TREE_CODE (type) == RECORD_TYPE)
 	return build_static_class_ref (type);



More information about the Gcc-patches mailing list