This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]