diff options
author | mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-13 21:34:52 +0000 |
---|---|---|
committer | mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-13 21:34:52 +0000 |
commit | 62248d0afd1947b56dc3b6980f2f551e7d5d7eb5 (patch) | |
tree | 11cf9820abde4b603bbec44402852023a55e10fd /libjava/java | |
parent | 7cd25332b5d0e0d610d97f5cd7fe6541c35d8346 (diff) | |
download | gcc-62248d0afd1947b56dc3b6980f2f551e7d5d7eb5.tar.gz |
Fix return type handling for Proxy classes
libjava/
* java/lang/reflect/natVMProxy.cc (unbox): Use ffi_arg for
integer return types smaller than a word.
* testsuite/libjava.jar/ReturnInvocationHandler.java: New file.
* testsuite/libjava.jar/ReturnProxyTest.jar: Likewise.
* testsuite/libjava.jar/ReturnProxyTest.java: Likewise.
* testsuite/libjava.jar/ReturnProxyTest.out: Likewise.
* testsuite/libjava.jar/ReturnProxyTest.xfail: Likewise.
* testsuite/libjava.jar/ReturnTypes.java: Likewise.
* testsuite/libjava.jar/ReturnTypesImpl.java: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/reflect/natVMProxy.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libjava/java/lang/reflect/natVMProxy.cc b/libjava/java/lang/reflect/natVMProxy.cc index e46263d858c..19cde207835 100644 --- a/libjava/java/lang/reflect/natVMProxy.cc +++ b/libjava/java/lang/reflect/natVMProxy.cc @@ -272,17 +272,17 @@ unbox (jobject o, jclass klass, void *rvalue, FFI_TYPE type) if (klass == JvPrimClass (byte)) { _Jv_CheckCast (&Byte::class$, o); - *(jbyte*)rvalue = ((Byte*)o)->byteValue(); + *(ffi_arg*)rvalue = ((Byte*)o)->byteValue(); } else if (klass == JvPrimClass (short)) { _Jv_CheckCast (&Short::class$, o); - *(jshort*)rvalue = ((Short*)o)->shortValue(); + *(ffi_arg*)rvalue = ((Short*)o)->shortValue(); } else if (klass == JvPrimClass (int)) { _Jv_CheckCast (&Integer::class$, o); - *(jint*)rvalue = ((Integer*)o)->intValue(); + *(ffi_arg*)rvalue = ((Integer*)o)->intValue(); } else if (klass == JvPrimClass (long)) { @@ -302,12 +302,12 @@ unbox (jobject o, jclass klass, void *rvalue, FFI_TYPE type) else if (klass == JvPrimClass (boolean)) { _Jv_CheckCast (&Boolean::class$, o); - *(jboolean*)rvalue = ((Boolean*)o)->booleanValue(); + *(ffi_arg*)rvalue = ((Boolean*)o)->booleanValue(); } else if (klass == JvPrimClass (char)) { _Jv_CheckCast (&Character::class$, o); - *(jchar*)rvalue = ((Character*)o)->charValue(); + *(ffi_arg*)rvalue = ((Character*)o)->charValue(); } else JvFail ("Bad ffi type in proxy"); |