OSDN Git Service

Obvious jni weak reference fix
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Nov 2001 21:32:22 +0000 (21:32 +0000)
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Nov 2001 21:32:22 +0000 (21:32 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47128 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/jni.cc

index 6c9cf85..173cef9 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-17  Anthony Green  <green@redhat.com>
+
+       * jni.cc (unwrap): Fix test for wrapped objects.
+
 2001-11-16  Tom Tromey  <tromey@redhat.com>
 
        * verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handle
index 1aa77bc..dbe1d1f 100644 (file)
@@ -212,7 +212,7 @@ unwrap (T *obj)
   using namespace gnu::gcj::runtime;
   // We can compare the class directly because JNIWeakRef is `final'.
   // Doing it this way is much faster.
-  if (obj == NULL || obj->getClass () == &JNIWeakRef::class$)
+  if (obj == NULL || obj->getClass () != &JNIWeakRef::class$)
     return obj;
   JNIWeakRef *wr = reinterpret_cast<JNIWeakRef *> (obj);
   return reinterpret_cast<T *> (wr->get ());