From: Ulrich Weigand Date: Tue, 13 Jul 2004 21:06:33 +0000 (+0000) Subject: interpret.cc (run): Correctly access libffi return values of integral smaller-than... X-Git-Tag: releases/gcc-4.0.0~6660 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5549179ffbab093da7b35296973c2a287ad60f20;p=thirdparty%2Fgcc.git interpret.cc (run): Correctly access libffi return values of integral smaller-than-int type... * interpret.cc (run): Correctly access libffi return values of integral smaller-than-int type; these are implicitly promoted. From-SVN: r84645 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 476795a111de..5460fae445ac 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-07-13 Ulrich Weigand + + * interpret.cc (run): Correctly access libffi return values of + integral smaller-than-int type; these are implicitly promoted. + 2004-07-13 Bryce McKinlay PR libgcj/7587 diff --git a/libjava/interpret.cc b/libjava/interpret.cc index 40c7cbaac5a8..109ee10ff8b3 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -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: