This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/15001] Using JNI with interpreter and interface methods yields SIGSEGV


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]