mirror of
https://github.com/python/cpython.git
synced 2024-11-30 21:34:17 +08:00
Fix for issue9662, patch by Łukasz Langa in issue5504.
This commit is contained in:
parent
713f2aa569
commit
2decf22b95
@ -416,9 +416,13 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
|
||||
"ffi_prep_cif failed with %d", result);
|
||||
goto error;
|
||||
}
|
||||
#if defined(X86_DARWIN) || defined(POWERPC_DARWIN)
|
||||
result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
|
||||
#else
|
||||
result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
|
||||
p,
|
||||
p->pcl_exec);
|
||||
#endif
|
||||
if (result != FFI_OK) {
|
||||
PyErr_Format(PyExc_RuntimeError,
|
||||
"ffi_prep_closure failed with %d", result);
|
||||
|
@ -264,6 +264,9 @@ ffi_prep_closure(
|
||||
void (*fun)(ffi_cif*,void*,void**,void*),
|
||||
void* user_data);
|
||||
|
||||
void ffi_closure_free(void *);
|
||||
void *ffi_closure_alloc (size_t size, void **code);
|
||||
|
||||
typedef struct ffi_raw_closure {
|
||||
char tramp[FFI_TRAMPOLINE_SIZE];
|
||||
ffi_cif* cif;
|
||||
@ -349,4 +352,4 @@ ffi_call(
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // #ifndef LIBFFI_H
|
||||
#endif // #ifndef LIBFFI_H
|
||||
|
@ -106,7 +106,6 @@ void *ffi_closure_alloc(size_t ignored, void** codeloc)
|
||||
return NULL;
|
||||
item = free_list;
|
||||
free_list = item->next;
|
||||
*codeloc = (void *)item;
|
||||
*codeloc = (void *)item;
|
||||
return (void *)item;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user