This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: Two bugs in unix64.S
- From: Dan Witte <dwitte at mozilla dot com>
- To: Armin Rigo <arigo at tunes dot org>
- Cc: libffi-discuss at sources dot redhat dot com
- Date: Wed, 8 Dec 2010 17:23:41 -0800 (PST)
- Subject: Re: Two bugs in unix64.S
----- Original Message -----
> completely. My guess is that any project that has, so far, needed the
> feature has found out by trial-and-error that ffi_call() does *not*
> fill it completely (e.g. by running it on win32, or by noticing the
> wrong sign- vs. zero-extension done by unix64), and just assumed that
> only the lower bits are valid. I suppose it can be fixed in the
> various .S files supporting ffi_call(); I can try to propose tests to
> cover this case, and a patch for unix64.S and possibly win32.S.
Indeed. For instance, in Firefox we immediately cast the ffi_arg value back to the native size and discard the irrelevant bits. Other client code might not do this, so it's probably a good idea to fix the implementations...
Regards,
Dan.