This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Patch] PR java/21418: Order of files on command line matters whileresolving inheritance
- From: Andrew Haley <aph at redhat dot com>
- To: Ranjit Mathew <rmathew at gmail dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, mark at klomp dot org
- Date: Wed, 21 Sep 2005 11:09:09 +0100
- Subject: Re: [Patch] PR java/21418: Order of files on command line matters whileresolving inheritance
- References: <43312D9C.4090105@gmail.com>
Ranjit Mathew writes:
>
> PR java/21418
> * class.c (inherits_from_p): Try to lay out super class
> if it is not already laid out.
>
> Index: class.c
> ===================================================================
> --- class.c 2005-09-21 12:36:32.000000000 +0530
> +++ class.c 2005-09-21 12:58:52.000000000 +0530
> @@ -546,11 +546,22 @@ int
> inherits_from_p (tree type1, tree type2)
> {
> + tree super_class;
> +
> while (type1 != NULL_TREE && TREE_CODE (type1) == RECORD_TYPE)
> {
> if (type1 == type2)
> return 1;
> +
> if (! CLASS_LOADED_P (type1))
> load_class (type1, 1);
> - type1 = CLASSTYPE_SUPER (type1);
> +
> + super_class = CLASSTYPE_SUPER (type1);
> +
> + if (super_class && TREE_CODE (super_class) == POINTER_TYPE)
I don't quite understand this test for POINTER_TYPE.
Andrew.
> + {
> + super_class = maybe_layout_super_class (super_class, type1);
> + }
> +
> + type1 = super_class;
> }
> return 0;