diff options
author | Anthony Green <green@redhat.com> | 2002-03-01 05:36:31 +0000 |
---|---|---|
committer | Anthony Green <green@gcc.gnu.org> | 2002-03-01 05:36:31 +0000 |
commit | 562ff1637faf0ce60e65c13a9a7c27015b6226bc (patch) | |
tree | fee50ca42721a37c89d4a83d75b79098c5200676 /libjava/java | |
parent | cc36a670f7286d12e924dcf273259a511a96b3a7 (diff) | |
download | gcc-562ff1637faf0ce60e65c13a9a7c27015b6226bc.tar.gz |
Add pointer support to the reflection code.
From-SVN: r50180
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index e11e5c3677c..d4cbb72ed96 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -426,6 +426,7 @@ _Jv_CallAnyMethodA (jobject obj, union { ffi_arg i; + jobject o; jlong l; jfloat f; jdouble d; @@ -448,37 +449,43 @@ _Jv_CallAnyMethodA (jobject obj, // a narrowing conversion for jbyte, jchar, etc. results. // Note that boolean is handled either by the FFI_TYPE_SINT8 or // FFI_TYPE_SINT32 case. - switch (rtype->type) - { - case FFI_TYPE_VOID: - break; - case FFI_TYPE_SINT8: - result->b = (jbyte)ffi_result.i; - break; - case FFI_TYPE_SINT16: - result->s = (jshort)ffi_result.i; - break; - case FFI_TYPE_UINT16: - result->c = (jchar)ffi_result.i; - break; - case FFI_TYPE_SINT32: - result->i = (jint)ffi_result.i; - break; - case FFI_TYPE_SINT64: - result->j = (jlong)ffi_result.l; - break; - case FFI_TYPE_FLOAT: - result->f = (jfloat)ffi_result.f; - break; - case FFI_TYPE_DOUBLE: - result->d = (jdouble)ffi_result.d; - break; - default: - JvFail ("Unknown ffi_call return type"); - break; - } if (is_constructor) result->l = obj; + else + { + switch (rtype->type) + { + case FFI_TYPE_VOID: + break; + case FFI_TYPE_SINT8: + result->b = (jbyte)ffi_result.i; + break; + case FFI_TYPE_SINT16: + result->s = (jshort)ffi_result.i; + break; + case FFI_TYPE_UINT16: + result->c = (jchar)ffi_result.i; + break; + case FFI_TYPE_SINT32: + result->i = (jint)ffi_result.i; + break; + case FFI_TYPE_SINT64: + result->j = (jlong)ffi_result.l; + break; + case FFI_TYPE_FLOAT: + result->f = (jfloat)ffi_result.f; + break; + case FFI_TYPE_DOUBLE: + result->d = (jdouble)ffi_result.d; + break; + case FFI_TYPE_POINTER: + result->l = (jobject)ffi_result.o; + break; + default: + JvFail ("Unknown ffi_call return type"); + break; + } + } return ex; #else |