[cffi-devel] Re: corrupted foreign structure testcase with latest CFFI and LW 4.4.6

Luís Oliveira luismbo at gmail.com
Wed Jun 7 02:37:33 UTC 2006


On 2006-jun-07, at 00:58, Jack Unrue wrote:
> The changes in 060215's version of cffi-lispworks.lisp are
> that the following have been added:
>
> defun convert-foreign-typed-aref-type
> defun pointer-and-index
> compiler macros for %mem-ref and %mem-set

Bingo.


> Hopefully this code spelunking can help track down what's
> happened :-)

Yeah, those compiler macros were calling fli:foreign-typed-aref  
incorrectly. I remember James and I discussing this optimization and  
we were both tricked by the documentation that suggests this function  
takes an array index, not an offset in bytes.

I've pushed a fix to the darcs repository. Thank you for the report  
and test case. And thank you and Luke for tracking the down the  
changes that introduced this bug. :-)

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/





More information about the cffi-devel mailing list