re PR libgcj/28178 (jniEnv->DeleteLocalRef (null) fails)
PR libgcj/28178: * jni.cc (_Jv_JNI_DeleteLocalRef): Ignore null argument. (_Jv_JNI_DeleteGlobalRef): Likewise. * testsuite/libjava.jni/PR28178.java: New file. * testsuite/libjava.jni/PR28178.c: New file. * testsuite/libjava.jni/PR28178.out: New file. From-SVN: r115034
This commit is contained in:
parent
578089dba0
commit
10caa6ef96
5 changed files with 45 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
|||
2006-06-27 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
PR libgcj/28178:
|
||||
* jni.cc (_Jv_JNI_DeleteLocalRef): Ignore null argument.
|
||||
(_Jv_JNI_DeleteGlobalRef): Likewise.
|
||||
* testsuite/libjava.jni/PR28178.java: New file.
|
||||
* testsuite/libjava.jni/PR28178.c: New file.
|
||||
* testsuite/libjava.jni/PR28178.out: New file.
|
||||
|
||||
2006-06-26 Keith Seitz <keiths@redhat.com>
|
||||
|
||||
* include/posix-threads.h: Fix coding style aberrations from
|
||||
|
|
|
@ -248,6 +248,12 @@ _Jv_JNI_DeleteGlobalRef (JNIEnv *, jobject obj)
|
|||
{
|
||||
// This seems weird but I think it is correct.
|
||||
obj = unwrap (obj);
|
||||
|
||||
// NULL is ok here -- the JNI specification doesn't say so, but this
|
||||
// is a no-op.
|
||||
if (! obj)
|
||||
return;
|
||||
|
||||
unmark_for_gc (obj, global_ref_table);
|
||||
}
|
||||
|
||||
|
@ -259,6 +265,11 @@ _Jv_JNI_DeleteLocalRef (JNIEnv *env, jobject obj)
|
|||
// This seems weird but I think it is correct.
|
||||
obj = unwrap (obj);
|
||||
|
||||
// NULL is ok here -- the JNI specification doesn't say so, but this
|
||||
// is a no-op.
|
||||
if (! obj)
|
||||
return;
|
||||
|
||||
for (frame = env->locals; frame != NULL; frame = frame->next)
|
||||
{
|
||||
for (int i = 0; i < frame->size; ++i)
|
||||
|
|
10
libjava/testsuite/libjava.jni/PR28178.c
Normal file
10
libjava/testsuite/libjava.jni/PR28178.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <PR28178.h>
|
||||
|
||||
void
|
||||
Java_PR28178_m (JNIEnv *env, jclass ignore)
|
||||
{
|
||||
(*env)->DeleteLocalRef(env, NULL);
|
||||
(*env)->DeleteGlobalRef(env, NULL);
|
||||
}
|
||||
|
||||
|
15
libjava/testsuite/libjava.jni/PR28178.java
Normal file
15
libjava/testsuite/libjava.jni/PR28178.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Regression test for PR 28178.
|
||||
|
||||
public class PR28178
|
||||
{
|
||||
static {
|
||||
System.loadLibrary("PR28178");
|
||||
}
|
||||
|
||||
public static native void m();
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
m();
|
||||
}
|
||||
}
|
0
libjava/testsuite/libjava.jni/PR28178.out
Normal file
0
libjava/testsuite/libjava.jni/PR28178.out
Normal file
Loading…
Add table
Add a link
Reference in a new issue