This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: FYI: fix PR java/36247
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 14 Jun 2008 13:47:50 -0600
- Subject: Patch: FYI: fix PR java/36247
- Reply-to: tromey at redhat dot com
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);