Re: [Sablevm-developer] powerpc port status
Brought to you by:
egagnon
From: Etienne M. G. <eti...@uq...> - 2002-12-13 22:55:03
|
On Fri, Dec 13, 2002 at 05:18:42PM -0500, David Paul BELANGER wrote: > Accessing the value simply with: > params[0].jint = result[0].jint; >... > The other possible fix is to take byte at offset 3 for big endian > machines: > *(((unsigned char*) &v) + 3) > this does not rely on the layout of the union in memory. Yes, it actually does! So, this would be wrong, as libffi was given ((unsigned char*) &v) as the location to store a "char", not and "int". So, SableVM's source code is correct. "params[0].jint = result[0].jint;" should fail on a big-endian machine! (It makes sense for this code *not* to work on both big and little-endian machines, if a "char" value was stored at &result). Maybe we should add an "#if defined(LIBFFIBUG) ... #endif" clause with the temporary bug evasion for now, and submit a bug against libffi (try "reportbug libffi2" on Debian, assuming reportbug is installed). Etienne -- Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |