3141ed0fe0
gcc/java: PR java/18278: * expr.c (build_jni_stub): Unwrap the return value. * java-tree.h (soft_unwrapjni_node): New define. (enum java_tree_index): Added JTI_SOFT_UNWRAPJNI_NODE. * decl.c (java_init_decl_processing): Initialize soft_unwrapjni_node. libjava: PR java/18278: * testsuite/libjava.jni/pr18278.out: New file. * testsuite/libjava.jni/pr18278.c: New file. * testsuite/libjava.jni/pr18278.java: New file. * include/jvm.h (_Jv_UnwrapJNIweakReference): Declare. * jni.cc (_Jv_UnwrapJNIweakReference): New function. (call): Unwrap return value if needed. From-SVN: r107676
11 lines
196 B
C
11 lines
196 B
C
#include <jni.h>
|
|
#include <stdio.h>
|
|
|
|
#include "pr18278.h"
|
|
|
|
jobject Java_pr18278_weakRef(JNIEnv *env, jclass cls, jobject data)
|
|
{
|
|
jobject r = (* env)->NewWeakGlobalRef(env, data);
|
|
return r;
|
|
}
|