Hi, all

> 
> The following patch includes the one posted yesterday. It fixes
> jbooleans, jbytes, jchars. jshort, jlongs and jdoubles. It has been
> tested on Sparc and PowerPC hosts, and it also works correctly on x86 hosts.
>

Here is a little update. It now distinguishes libffi and stubs when
handling the value returned by native methods.

> 
> diff -u lib/libruntime/nativeglue.c.ini lib/librunime/nativeglue.c
> --- lib/libruntime/nativeglue.c.ini     Tue Feb 23 19:02:52 1999
> +++ lib/libruntime/nativeglue.c Tue Feb 23 17:09:28 1999
> @@ -345,6 +345,19 @@
>  
>    THREAD_INFO(new_frame)->return_value.value = args[0];
>  
> +  {
> +    SigPrimType* tag = &THREAD_INFO(new_frame)->return_value.tag;
> +    if(*tag == SIG_JCHAR
> +       || *tag == SIG_JBYTE
> +       || *tag == SIG_JSHORT
> +       || *tag == SIG_JBOOLEAN) {
> +         /* returned value is stored as a jint; neglecting to correct 
> +            return_value.tag induces an incorrect promotion to jint 
> +            in op_stack_push_value() on bigendian hosts */
> +         *tag = SIG_JINT;
> +       }
> +  }
> +
>    maybe_push_return_value(new_frame);
>    
>    /* then pop the frame off */



 diff -u lib/libruntime/nativeglue.c.ini lib/libruntme/nativeglue.c
--- lib/libruntime/nativeglue.c.ini     Tue Feb 23 19:02:52 1999
+++ lib/libruntime/nativeglue.c Thu Feb 25 17:16:08 1999
@@ -345,6 +345,22 @@
 
   THREAD_INFO(new_frame)->return_value.value = args[0];
 
+  {
+    SigPrimType* tag = &THREAD_INFO(new_frame)->return_value.tag;
+    if(*tag == SIG_JBOOLEAN
+#ifdef HAVE_LIBFFI
+       || *tag == SIG_JCHAR
+       || *tag == SIG_JBYTE
+       || *tag == SIG_JSHORT
+#endif
+      ) {
+         /* returned value is stored as a jint; neglecting to correct 
+            return_value.tag induces an incorrect promotion to jint 
+            in op_stack_push_value() on bigendian hosts */
+         *tag = SIG_JINT;
+       }
+  }
+
   maybe_push_return_value(new_frame);
   
   /* then pop the frame off */



--Christophe

Reply via email to