diff options
author | Tom Tromey <tromey@redhat.com> | 2005-11-29 18:34:58 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-11-29 18:34:58 +0000 |
commit | 3141ed0fe01e5e5cd726dc6410f49a0323361d94 (patch) | |
tree | 5ba6f0f10a37c9d1c36de0493f0563ef6f583cad /gcc/java/decl.c | |
parent | 4311c8e54c31efed7aa9aaef244a4ac93fbf96d2 (diff) | |
download | gcc-3141ed0fe01e5e5cd726dc6410f49a0323361d94.zip gcc-3141ed0fe01e5e5cd726dc6410f49a0323361d94.tar.gz gcc-3141ed0fe01e5e5cd726dc6410f49a0323361d94.tar.bz2 |
re PR java/18278 (JNI functions cannot return a weak reference)
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
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r-- | gcc/java/decl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index de8f9ad..21488ff 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1169,6 +1169,12 @@ java_init_decl_processing (void) build_function_type (void_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); + t = tree_cons (NULL_TREE, object_ptr_type_node, endlink); + soft_unwrapjni_node + = builtin_function ("_Jv_UnwrapJNIweakReference", + build_function_type (object_ptr_type_node, t), + 0, NOT_BUILT_IN, NULL, NULL_TREE); + t = tree_cons (NULL_TREE, int_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_idiv_node |