This is the mail archive of the java-patches@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]

Re: Fix for the env->klass field value in _Jv_JNIMethod::call


Hi Ivan,

On Sun, 2006-07-30 at 10:23 +0700, Ivan Dubrov wrote: 
> While debugging the issue with the Subclipse not working under the GCJ
> (look at the message
> http://svn.haxx.se/subusers/archive-2006-07/0210.shtml for example) I
> found the following problem. When native method is called, the
> env->klass value is always NULL. It looks like that JNIEnv is reused in
> the "_Jv_GetJNIEnvNewFrame" function and the env->klass value is not
> updated during the call.

Nice catch!

> Perhaps, it is OK in most cases, except the cases with complex
> classloaders logic.

It is probably never correct. We were most likely just lucky that no JNI
library ever tried to load classes not found through the system class
loader. So we probably should just update env->klass inside
_Jv_GetJNIEnvNewFrame itself, just like we reset the pending exception.
_Jv_GetJNIEnvNewFrame already gets the defining class as argument.

Thanks,

Mark


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