Handling narrow return types on x86

Bug #622251 reported by Luís Oliveira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
New
Medium
Unassigned

Bug Description

On Thu, Mar 26, 2009 at 9:03 PM, Jean-Claude Beaudoin
<email address hidden> wrote:
> Recent versions of GCC appear to be leaving spurious bits in the %eax
> register used to return the value of a C function on x86 based platforms
> when the return type is narrower than 32 bits (ie: short or char). SBCL
> does not defend itself against such register pollution and will return an
> incorrect value made up of those spurious bits in addition to the intended
> value. A partial fix for "signed" short and char has appeared in SBCL
> 1.0.25 but the "unsigned" cases are still vulnerable. I suggest that CFFI
> should defend itself against that dangerously permissive handling of narrow
> return types in SBCL through the use of a few filtering functions to be
> applied in those relevant cases, at least until SBCL fixes the issue for
> good.

Before any fix is commited, this bug should be reproduced/investigated
(it deserves to be well explained somewhere in the source code) and a
test case written.

Further discussion: <http://thread.gmane.org/gmane.lisp.cffi.devel/1569>

Tags: x86
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.