diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-07 22:45:11 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-07 22:45:11 +0000 |
commit | 6d84c3e2de7dfb7e3c7742541701ce67676d9735 (patch) | |
tree | dde78be310ecc3b5e900fbc50be51aea3f79076f /libjava | |
parent | 8f92f0732e74ef17dfb722cf457682843afe61d7 (diff) | |
download | gcc-6d84c3e2de7dfb7e3c7742541701ce67676d9735.tar.gz |
2007-02-01 Marco Trudel <mtrudel@gmx.ch>
* jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121699 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/jni.cc | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 06c1a1f9e97..561f8262056 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2007-02-01 Marco Trudel <mtrudel@gmx.ch> + + * jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects. + 2007-02-07 Tom Tromey <tromey@redhat.com> * testsuite/libjava.jni/init.c: New file. diff --git a/libjava/jni.cc b/libjava/jni.cc index 07ef7134540..d71b16d99ea 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -1750,6 +1750,10 @@ _Jv_JNI_NewWeakGlobalRef (JNIEnv *env, jobject obj) void JNICALL _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj) { + // JDK compatibility. + if (obj == NULL) + return; + using namespace gnu::gcj::runtime; JNIWeakRef *ref = reinterpret_cast<JNIWeakRef *> (obj); unmark_for_gc (ref, global_ref_table); |