interpret.cc (run): Correctly access libffi return values of integral smaller-than...
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 13 Jul 2004 21:06:33 +0000 (21:06 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 13 Jul 2004 21:06:33 +0000 (21:06 +0000)
* interpret.cc (run): Correctly access libffi return values of
integral smaller-than-int type; these are implicitly promoted.

From-SVN: r84645

libjava/ChangeLog
libjava/interpret.cc

index 476795a111de7ea0fe55e628040a19ddf1c94736..5460fae445ace5e17dd9f909f945b843e2d0eb46 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-13  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * interpret.cc (run): Correctly access libffi return values of
+       integral smaller-than-int type; these are implicitly promoted.
+
 2004-07-13  Bryce McKinlay  <mckinlay@redhat.com>
 
        PR libgcj/7587
index 40c7cbaac5a8ddc889e4215d756b464310ab1b52..109ee10ff8b3e9a3b712993adb08ed69b1b189ce 100644 (file)
@@ -1207,15 +1207,15 @@ _Jv_InterpMethod::run (void *retp, ffi_raw *args)
            switch (rtype)
              {
              case FFI_TYPE_SINT8:
-               PUSHI (rvalue.byte_value);
+               PUSHI ((jbyte)(rvalue.int_value & 0xff));
                break;
 
              case FFI_TYPE_SINT16:
-               PUSHI (rvalue.short_value);
+               PUSHI ((jshort)(rvalue.int_value & 0xffff));
                break;
 
              case FFI_TYPE_UINT16:
-               PUSHI (rvalue.char_value);
+               PUSHI (rvalue.int_value & 0xffff);
                break;
 
              case FFI_TYPE_FLOAT: