public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1260: Compiler generates call to wrong method from inner class
@ 2000-12-20 12:23 bryce
0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:23 UTC (permalink / raw)
To: java-gnats
>Number: 1260
>Category: java
>Synopsis: Compiler generates call to wrong method from inner class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:18:23 PST 2000
>Closed-Date: Thu Jul 20 17:05:05 PDT 2000
>Last-Modified: Thu Jul 20 17:16:01 PDT 2000
>Originator: Bryce McKinlay
>Release: unknown-1.0
>Organization:
>Environment:
gcc version 2.96 20000523 (experimental) w/ PR177 fix
>Description:
When an inner class tries to call a method that is defined
in a superclass of its enclosing class, the compiler calls
the wrong method. It seems to get the right offset, but
in the wrong vtable.
>How-To-Repeat:
Try running the test case (attached)
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/242
From: bryce@sourceware.cygnus.com
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: gcj/242
Date: 29 May 2000 05:26:15 -0000
CVSROOT: /cvs/java
Module name: libgcj
Changes by: bryce@sourceware.cygnus.com 00/05/28 22:26:14
Modified files:
libjava/testsuite: ChangeLog
Added files:
libjava/testsuite/libjava.lang: PR242.java PR242.out
Log message:
2000-05-29 Bryce McKinlay <bryce@albatross.co.nz>
* libjava.lang/PR242.java: New file. PR gcj/242.
Patches:
http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/ChangeLog.diff?cvsroot=java&r1=1.99&r2=1.100
http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/libjava.lang/PR242.java.diff?cvsroot=java&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/gcc/libjava/testsuite/libjava.lang/PR242.out.diff?cvsroot=java&r1=NONE&r2=1.1
State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Jul 13 18:48:33 2000
State-Changed-Why:
Good catch Mo. `someNum' wasn't called on the right context,
because inheritance wasn't taken into consideration when
looking for a way to someNum. I attached a patch.
From: apbianco@cygnus.com
To: apbianco@cygnus.com, bryce@albatross.co.nz,
java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: 14 Jul 2000 01:48:33 -0000
Synopsis: Compiler generates call to wrong method from inner class
State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Jul 13 18:48:33 2000
State-Changed-Why:
Good catch Mo. `someNum' wasn't called on the right context,
because inheritance wasn't taken into consideration when
looking for a way to someNum. I attached a patch.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=242&database=java
From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: Thu, 13 Jul 2000 20:20:59 -0700 (PDT)
apbianco@cygnus.com writes:
> Good catch Mo.
Er, Bryce :-)
./A
From: Bryce McKinlay <bryce@albatross.co.nz>
To: apbianco@cygnus.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/242
Date: Sat, 15 Jul 2000 18:27:53 +1200
apbianco@cygnus.com wrote:
> Good catch Mo. `someNum' wasn't called on the right context,
> because inheritance wasn't taken into consideration when
> looking for a way to someNum. I attached a patch.
>
> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=242&database=java
Hi Alex,
Thanks for the patches!
I've just done another bulk patch test, installing and testing the patches for
the following PRs:
242
249
239
225
256
I rebuilt libgcj and ran a few ad-hoc tests with these applied. The results
look good, although there appears to be a separate regression that messes up
some of the test cases when doing a "-C" or compiling partly from .class files.
The PR225 test, for example:
[bryce@hokkaido PR225]$ gcj -C ProtectedInnerInterface.java
foo/ProtectedInnerInterface_OtherPkgTest3.java
foo/ProtectedInnerInterface_OtherPkgTest3.java:8: Superinterface
`ProtectedInnerInterface.Inter' of class
`foo.ProtectedInnerInterface_OtherPkgTest3' not found.
ProtectedInnerInterface.Inter {}
^
gcj: Internal error: Segmentation fault (program jc1)
This is not caused by any of the above fixes, however, as the same problem
occurs in the unmodified current cvs tree.
Thanks again: with the 242 fix I should be able to take another look at the
collections implementation soon.
regards
[ bryce ]
From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: Thu, 20 Jul 2000 11:27:25 -0700 (PDT)
Bryce McKinlay writes:
> I've just done another bulk patch test, installing and testing the
> patches for the following PRs:
Thanks!
> [bryce@hokkaido PR225]$ gcj -C ProtectedInnerInterface.java
> foo/ProtectedInnerInterface_OtherPkgTest3.java
> foo/ProtectedInnerInterface_OtherPkgTest3.java:8: Superinterface
> `ProtectedInnerInterface.Inter' of class
> `foo.ProtectedInnerInterface_OtherPkgTest3' not found.
> ProtectedInnerInterface.Inter {}
> ^
> gcj: Internal error: Segmentation fault (program jc1)
Yes. Tom privately reported to me a similar problem. I think I have a
patch, though it hasn't been thoroughly tested (yet.)
./A
2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (find_as_inner_class): Handle the case where the
enclosing context of an innerclass has been loaded as bytecode.
Index: parse.y
===================================================================
diff -u -p parse.y
--- old-/home/apbianco/src/egcs/gcc/.java-ref/parse.y Wed Jul 19 12:40:25 2000
+++ parse.y Wed Jul 19 15:21:44 2000
@@ -3492,7 +3492,18 @@ find_as_inner_class (enclosing, name, cl
else
qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE);
- return find_as_inner_class_do (qual, enclosing);
+ if (!(to_return = find_as_inner_class_do (qual, enclosing)))
+ {
+ /* It might be the case that the enclosing class was loaded as
+ bytecode, in which case it will be missing the
+ DECL_INNER_CLASS_LIST. We build a fully qualified internal
+ innerclass name and we try to load it. */
+ tree fqin = identifier_subst (name, "", '.', '$', "");
+ tree ptr;
+ BUILD_PTR_FROM_NAME (ptr, fqin);
+ to_return = resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
+ }
+ return to_return;
}
/* We go inside the list of sub classes and try to find a way
From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: Thu, 20 Jul 2000 11:29:23 -0700 (PDT)
Bryce McKinlay writes:
> I've just done another bulk patch test, installing and testing the
> patches for the following PRs:
> 242, 249, 239, 225, 256
Oh, by the way, I was thinking about closing all these PRs at once and
issue only one (bigger) patch. Is it terribly bothering anyone? The
first one to answer will set the policy.
./A
From: Tom Tromey <tromey@cygnus.com>
To: Alexandre Petit-Bianco <apbianco@cygnus.com>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/242
Date: Thu, 20 Jul 2000 11:38:42 -0700 (PDT)
Alex> Oh, by the way, I was thinking about closing all these PRs at
Alex> once and issue only one (bigger) patch. Is it terribly
Alex> bothering anyone? The first one to answer will set the policy.
As long as each person who submitted a PR gets a message saying "apply
patch X", then it doesn't matter to me.
Tom
From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: Thu, 20 Jul 2000 11:49:41 -0700 (PDT)
Tom Tromey writes:
> As long as each person who submitted a PR gets a message saying
> "apply patch X", then it doesn't matter to me.
That's what I had in mind.
./A
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Thu Jul 20 17:05:05 2000
State-Changed-Why:
I checked in a jumbo patch to fix 242 and other PRs:
http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00801.html
Note that the side mixed source/bytecode compilation bug is
addressed by a patch that will be checked in as soon as it
gets tested.
From: apbianco@cygnus.com
To: apbianco@cygnus.com, bryce@albatross.co.nz,
java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/242
Date: 21 Jul 2000 00:05:05 -0000
Synopsis: Compiler generates call to wrong method from inner class
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Thu Jul 20 17:05:05 2000
State-Changed-Why:
I checked in a jumbo patch to fix 242 and other PRs:
http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00801.html
Note that the side mixed source/bytecode compilation bug is
addressed by a patch that will be checked in as soon as it
gets tested.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=242&database=java
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="PR242.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="PR242.java"
Y2xhc3MgQmFzZQp7CiAgaW50IHNvbWVOdW0oKQogIHsKICAgIFN5c3RlbS5vdXQucHJpbnRsbiAo
Im9rIik7CiAgICByZXR1cm4gMDsKICB9Cn0KCnB1YmxpYyBjbGFzcyBQUjI0MiBleHRlbmRzIEJh
c2UKewogIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZyBhcmdzW10pCiAgewogICAgbmV3
IFBSMjQyKCk7CiAgfQogIAogIFBSMjQyKCkKICB7CiAgICBuZXcgSW5uZXIoKS5hKCk7CiAgfQog
ICAgIAogIGNsYXNzIElubmVyCiAgewogICAgcHVibGljIGludCBkdW1teSgpCiAgICB7CiAgICAg
IFN5c3RlbS5vdXQucHJpbnRsbiAoIndyb25nIG1ldGhvZCBjYWxsZWQhISIpOwogICAgICByZXR1
cm4gLTE7CiAgICB9CiAgCiAgICBwdWJsaWMgdm9pZCBhKCkKICAgIHsKICAgICAgU3lzdGVtLm91
dC5wcmludGxuICgiLi4uIik7CiAgICAgIFN5c3RlbS5vdXQucHJpbnRsbiAoc29tZU51bSgpKTsg
ICAgCiAgICB9CiAgfQogIAp9Cg==----gnatsweb-attachment----
Content-Type: application/octet-stream; name="patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch"
MjAwMC0wNy0xMyAgQWxleGFuZHJlIFBldGl0LUJpYW5jbyAgPGFwYmlhbmNvQGN5Z251cy5jb20+
CgoJKiBwYXJzZS55IChwYXRjaF9tZXRob2RfaW52b2NhdGlvbik6IEZpeGVkIGNvbW1lbnQuCgko
b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
OwpAQCAtOTgxMSw3ICs5ODExLDcgQEAgbWF5YmVfdXNlX2FjY2Vzc19tZXRob2QgKGlzX3N1cGVy
X2luaXQsIAogICBpZiAobm9uX3N0YXRpY19jb250ZXh0KQogICAgIHsKICAgICAgIGN0eCA9IFRS
RUVfVFlQRSAoREVDTF9DT05URVhUIChUWVBFX05BTUUgKGN1cnJlbnRfY2xhc3MpKSk7Ci0gICAg
ICBpZiAoY3R4ID09IERFQ0xfQ09OVEVYVCAobWQpKQorICAgICAgaWYgKGluaGVyaXRzX2Zyb21f
cCAoY3R4LCBERUNMX0NPTlRFWFQgKG1kKSkpCiAJewogCSAgdGEgPSBidWlsZF9jdXJyZW50X3Ro
aXNuIChjdXJyZW50X2NsYXNzKTsKIAkgIHRhID0gYnVpbGRfd2ZsX25vZGUgKHRhKTsKQEAgLTk4
MjIsNyArOTgyMiw3IEBAIG1heWJlX3VzZV9hY2Nlc3NfbWV0aG9kIChpc19zdXBlcl9pbml0LCAK
IAkgIHdoaWxlICh0eXBlKQogCSAgICB7CiAJICAgICAgbWF5YmVfYnVpbGRfdGhpc25fYWNjZXNz
X21ldGhvZCAodHlwZSk7Ci0JICAgICAgaWYgKHR5cGUgPT0gREVDTF9DT05URVhUIChtZCkpCisJ
ICAgICAgaWYgKGluaGVyaXRzX2Zyb21fcCAodHlwZSwgREVDTF9DT05URVhUIChtZCkpKQogCQl7
CiAJCSAgdGEgPSBidWlsZF9hY2Nlc3NfdG9fdGhpc24gKGN0eCwgdHlwZSwgMCk7CiAJCSAgYnJl
YWs7ClJlcG9zaXRvcnk6IGBlZ2NzJwo=
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-12-20 12:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:23 java/1260: Compiler generates call to wrong method from inner class bryce
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).