Libffi problem on darwin (MacOSX)

Dale Johannesen dalej@apple.com
Fri May 16 21:42:00 GMT 2003


On Friday, May 16, 2003, at 01:55  PM, Ronald Oussoren wrote:
> We're using libffi closures in the Objective-C method tables to 
> forward calls from Objective-C to python. This is working fine for 
> basic calls, but gives wrong results when structs are passed. It looks 
> like a mismatch between the compiler and libffi: 
> ffi_closure_helper_DARWIN in libffi_darwin.c seems to assume that 
> structs are passed "by reference" (line 615), while the compiler 
> passes small structs entirely in registers (see assembly code emited 
> by the following C snippet):

I'm not familiar with libffi, but I can confirm that the compiler is 
doing the
right thing, and it's the same thing it's always done.  It looks like 
ffi_prep_args
and ffi_prep_cif_machdep correctly understand that structs are passed 
by value, so
this is just a bug in ffi_closure_helper_DARWIN.




More information about the Gcc mailing list