* 4.0 Patch: Fix PR java/21418
@ 2005-10-01 6:48 Bryce McKinlay
0 siblings, 0 replies; only message in thread
From: Bryce McKinlay @ 2005-10-01 6:48 UTC (permalink / raw)
To: java-patches, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
Another patch backport from HEAD. Ranjit's java/21418 fix and also a
small change from Per that it depends on. These are needed to reliably
build classpath. I'm checking them in.
Bryce
[-- Attachment #2: PR21418-gcc40.patch --]
[-- Type: text/x-patch, Size: 1744 bytes --]
2005-10-01 Ranjit Mathew <rmathew@gcc.gnu.org>
PR java/21418
* class.c (inherits_from_p): Try to lay out super class
if it is not already laid out.
(maybe_layout_super_class): Handle the case where SUPER_CLASS
is a NULL_TREE.
2005-10-01 Per Bothner <per@bothner.com>
* class.c (inherits_from_p): Do load_class if needed.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.220.8.6
diff -u -r1.220.8.6 class.c
--- class.c 1 Oct 2005 06:20:38 -0000 1.220.8.6
+++ class.c 1 Oct 2005 06:44:55 -0000
@@ -545,7 +545,11 @@
{
if (type1 == type2)
return 1;
- type1 = CLASSTYPE_SUPER (type1);
+
+ if (! CLASS_LOADED_P (type1))
+ load_class (type1, 1);
+
+ type1 = maybe_layout_super_class (CLASSTYPE_SUPER (type1), type1);
}
return 0;
}
@@ -2045,7 +2049,9 @@
static tree
maybe_layout_super_class (tree super_class, tree this_class)
{
- if (TREE_CODE (super_class) == RECORD_TYPE)
+ if (!super_class)
+ return NULL_TREE;
+ else if (TREE_CODE (super_class) == RECORD_TYPE)
{
if (!CLASS_LOADED_P (super_class) && CLASS_FROM_SOURCE_P (super_class))
safe_layout_class (super_class);
@@ -2060,13 +2066,13 @@
super_class = TREE_TYPE (super_class);
else
{
- /* Set the correct context for class resolution. */
- current_class = this_class;
-
/* do_resolve_class expects an EXPR_WITH_FILE_LOCATION, so
we give it one. */
tree this_wrap = NULL_TREE;
+ /* Set the correct context for class resolution. */
+ current_class = this_class;
+
if (this_class)
{
tree this_decl = TYPE_NAME (this_class);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-01 6:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-01 6:48 4.0 Patch: Fix PR java/21418 Bryce McKinlay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).