This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE
- From: "John E. Malmberg" <wb8tyw at qsl dot net>
- To: libffi-discuss at sourceware dot org
- Date: Wed, 15 Apr 2015 22:20:25 -0500
- Subject: src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE
- Authentication-results: sourceware.org; auth=none
I do not have a Tru64 system to test this on.
Looking at the code in src/alpha/ffitarget.h and src/alpha/ffi.c,
something does not look right.
FFI_TRAMPOLINE_SIZE is set to 24 in ffitarget.h
The typedef struct ffi_closure is then set up in ffi.h as:
typedef struct {
char tramp{FFI_TRAMPOLINE_SIZE];
ffi_cif * cif;
void (*fun)...
void *user_data
} ffi_closure
In ffi.c ffi_prep_closure_loc(), the code then does:
tramp = (unsigned int *) &closure->tramp[0];
....
*(void **) &tramp[4] = ffi_closure_osf;
But tramp only has 3 longword members per the previous declaration, so
&tramp[4] is the address of the '*cif' member of the structure which is
then updated:
closure->cif = cif;
Am I understanding this correctly?
Regards,
-John