Commit aee42017 by Anthony Green Committed by Anthony Green

Obvious jni weak reference fix

From-SVN: r47128
parent 089a05b8
2001-11-17 Anthony Green <green@redhat.com>
* jni.cc (unwrap): Fix test for wrapped objects.
2001-11-16 Tom Tromey <tromey@redhat.com> 2001-11-16 Tom Tromey <tromey@redhat.com>
* verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handle * verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handle
......
...@@ -212,7 +212,7 @@ unwrap (T *obj) ...@@ -212,7 +212,7 @@ unwrap (T *obj)
using namespace gnu::gcj::runtime; using namespace gnu::gcj::runtime;
// We can compare the class directly because JNIWeakRef is `final'. // We can compare the class directly because JNIWeakRef is `final'.
// Doing it this way is much faster. // Doing it this way is much faster.
if (obj == NULL || obj->getClass () == &JNIWeakRef::class$) if (obj == NULL || obj->getClass () != &JNIWeakRef::class$)
return obj; return obj;
JNIWeakRef *wr = reinterpret_cast<JNIWeakRef *> (obj); JNIWeakRef *wr = reinterpret_cast<JNIWeakRef *> (obj);
return reinterpret_cast<T *> (wr->get ()); return reinterpret_cast<T *> (wr->get ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment