This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Fix for the env->klass field value in _Jv_JNIMethod::call
>>>>> "Mark" == Mark Wielaard <mark@klomp.org> writes:
Mark> Ideally this would have been taken care of by _Jv_JNI_PopSystemFrame,
Mark> but that doesn't actually have the knowledge of the native method/klass
Mark> call nesting. Maybe we need to add a prev_klass field to
Mark> _Jv_JNI_LocalFrame so it can be restored if needed?
Mark> This is getting hairy though, your patch to just unconditionally set and
Mark> restore the klass field in the env is much clearer.
I looked at this patch and thread a little bit yesterday.
I think we need to add a field (or re-use one) to save the klass in
the system frame, and then restore it in _Jv_JNI_PopSystemFrame, as
you say. Otherwise, I think, it will always be possible to trash
'klass' -- Ivan's patch works fine when the class in question comes
from a .class, but I think the compiled case will still fail.
It would be very nice to have a standalone test case for this in the
libgcj test suite.
Tom