FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-148967: Fix FFI type pointer handling for C complex support in set_stginfo_ffi_type_pointer by sunmy2019 · Pull Request #148969 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions Modules/_ctypes/_ctypes.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,7 @@ c_void_p_from_param_impl(PyObject *type, PyTypeObject *cls, PyObject *value)
static int
set_stginfo_ffi_type_pointer(StgInfo *stginfo, struct fielddesc *fmt)
{
#if defined(_Py_FFI_SUPPORT_C_COMPLEX)
if (!fmt->pffi_type->elements) {
stginfo->ffi_type_pointer = *fmt->pffi_type;
}
Expand All @@ -2244,6 +2245,10 @@ set_stginfo_ffi_type_pointer(StgInfo *stginfo, struct fielddesc *fmt)
memcpy(stginfo->ffi_type_pointer.elements,
fmt->pffi_type->elements, els_size);
}
#else
assert(!fmt->pffi_type->elements);
stginfo->ffi_type_pointer = *fmt->pffi_type;
#endif
return 0;
}

Expand Down
Loading

Back | FazBrowse Home | New Git URL