diff options
Diffstat (limited to 'Modules/_ctypes/libffi_osx/ffi.c')
-rw-r--r-- | Modules/_ctypes/libffi_osx/ffi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/_ctypes/libffi_osx/ffi.c b/Modules/_ctypes/libffi_osx/ffi.c index bf420936db..96826b5c8e 100644 --- a/Modules/_ctypes/libffi_osx/ffi.c +++ b/Modules/_ctypes/libffi_osx/ffi.c @@ -38,12 +38,13 @@ initialize_aggregate( /*@out@*/ ffi_type* arg) { /*@-usedef@*/ + ffi_type** ptr; if (arg == NULL || arg->elements == NULL || arg->size != 0 || arg->alignment != 0) return FFI_BAD_TYPEDEF; - ffi_type** ptr = &(arg->elements[0]); + ptr = &(arg->elements[0]); while ((*ptr) != NULL) { @@ -135,16 +136,16 @@ ffi_prep_cif( /*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type* rtype, /*@dependent@*/ ffi_type** atypes) { + unsigned int bytes = 0; + unsigned int i; + ffi_type** ptr; + if (cif == NULL) return FFI_BAD_TYPEDEF; if (abi <= FFI_FIRST_ABI || abi > FFI_DEFAULT_ABI) return FFI_BAD_ABI; - unsigned int bytes = 0; - unsigned int i; - ffi_type** ptr; - cif->abi = abi; cif->arg_types = atypes; cif->nargs = nargs; |