Skip to content

Commit b8a66f5

Browse files
authored
[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
1 parent 6018930 commit b8a66f5

File tree

1 file changed

+10
-0
lines changed
  • offload/plugins-nextgen/host/dynamic_ffi

1 file changed

+10
-0
lines changed

offload/plugins-nextgen/host/dynamic_ffi/ffi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ typedef enum ffi_abi {
5353
#else
5454
#error "Unknown ABI"
5555
#endif
56+
} ffi_abi;
57+
58+
typedef struct {
59+
ffi_abi abi;
60+
unsigned nargs;
61+
ffi_type **arg_types;
62+
ffi_type *rtype;
63+
unsigned bytes;
64+
unsigned flags;
65+
long long extra_fields; // Longest extra field defined in the FFI sources
5666
} ffi_cif;
5767

5868
#ifdef __cplusplus

0 commit comments

Comments
 (0)