This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: Fix PR 21020
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 26 Apr 2005 14:48:30 -0600
- Subject: Patch: FYI: Fix PR 21020
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk.
This is a proper fix for PR 21020; for 4.0 we worked around this in a
different way. Andrew wrote this; I just ran across it again today
while looking through bugzilla a bit.
A while back I looked at all other callers of
_Jv_FindClassFromSignature; this one is the only problem.
Tom
Index: ChangeLog
from Andrew Haley <aph@redhat.com>
PR libgcj/21020:
* jni.cc (_Jv_JNI_GetAnyFieldID): Use class' loader to find
field's type.
Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.97
diff -u -r1.97 jni.cc
--- jni.cc 22 Apr 2005 19:02:38 -0000 1.97
+++ jni.cc 26 Apr 2005 20:43:12 -0000
@@ -1200,11 +1200,11 @@
char s[len + 1];
for (int i = 0; i <= len; ++i)
s[i] = (sig[i] == '/') ? '.' : sig[i];
- jclass field_class = _Jv_FindClassFromSignature ((char *) s, NULL);
+ java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
+ jclass field_class = _Jv_FindClassFromSignature ((char *) s, loader);
if (! field_class)
throw new java::lang::ClassNotFoundException(JvNewStringUTF(s));
- java::lang::ClassLoader *loader = clazz->getClassLoaderInternal ();
while (clazz != NULL)
{
// We acquire the class lock so that fields aren't resolved