Skip to content

Commit 5018200

Browse files
committed
+1
1 parent 37305c7 commit 5018200

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,8 @@ static PyObject *CreateSwappedType(ctypes_state *st, PyTypeObject *type,
22712271
stginfo->ffi_type_pointer = *fmt->pffi_type;
22722272
}
22732273
else {
2274-
const size_t els_size = sizeof(fmt->pffi_type->elements);
2274+
assert(fmt->pffi_type->type == FFI_TYPE_COMPLEX);
2275+
const size_t els_size = sizeof(2 * sizeof(ffi_type *));
22752276
stginfo->ffi_type_pointer.size = fmt->pffi_type->size;
22762277
stginfo->ffi_type_pointer.alignment = fmt->pffi_type->alignment;
22772278
stginfo->ffi_type_pointer.type = fmt->pffi_type->type;

0 commit comments

Comments
 (0)