This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/15001] Using JNI with interpreter and interface methods yields SIGSEGV
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Sep 2004 18:20:00 -0000
- Subject: [Bug libgcj/15001] Using JNI with interpreter and interface methods yields SIGSEGV
- References: <20040418092953.15001.thhal@mailblocks.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tromey at gcc dot gnu dot org 2004-09-21 18:19 -------
I looked at this a little, and wrote a test case
that can be checked in whenever we're ready.
This code is sort of a mess. A jmethodID doesn't
have a pointer back to its declaring class, so
we don't have an easy way to tell whether or not
it came from an interface.
We could search the "receiver" object's class hierarchy
for the concrete method and use that, but this is
inefficient.
One question I have is why method->index is not -1 for
a method declared in an interface. Perhaps declaring that
this must be -1 for such methods is the simplest fix.
Currently this is supposed to contain the dispatch index,
but I don't see that we ever use that.
Another approach would be to add a new flag to method->accflags
indicating that it is an interface method. This is a hack, but
would work. It would require going over bits of the runtime to
ensure that we mask this bit out as appropriate, e.g. when adding
Miranda methods to the concrete class hierarchy.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15001