[OFFLOAD] Update ffi_cif structure to match libffi (#128756)

The ffi_cif structure defined in the wrapper header is smaller than the
actual structure in libffi which results in other structures being
overwritten when libffi is called, and finally in a segfault.

The patch updates the structure to the correct layout as specified in
ffi.h
This commit is contained in:
Alex 2025-03-04 18:40:12 +01:00 committed by GitHub
parent 6018930ef1
commit b8a66f50b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,6 +53,16 @@ typedef enum ffi_abi {
#else
#error "Unknown ABI"
#endif
} ffi_abi;
typedef struct {
ffi_abi abi;
unsigned nargs;
ffi_type **arg_types;
ffi_type *rtype;
unsigned bytes;
unsigned flags;
long long extra_fields; // Longest extra field defined in the FFI sources
} ffi_cif;
#ifdef __cplusplus