cpython/Modules/_ctypes
Serhiy Storchaka 36153494f1
[3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) (GH-113624)
The length field of StgDictObject for Structure class contains now
the total number of items in ffi_type_pointer.elements (excluding
the trailing null).

The old behavior of using the number of elements in the parent class can
cause the array to be truncated when it is copied, especially when there
are multiple layers of subclassing.

(cherry picked from commit 5f3cc90a12)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
2024-01-01 16:46:07 +00:00
..
darwin [3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215) 2023-08-22 12:57:31 +03:00
libffi_osx [3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215) 2023-08-22 12:57:31 +03:00
_ctypes.c [3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) (GH-113624) 2024-01-01 16:46:07 +00:00
_ctypes_test.c [3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766) 2023-12-06 16:57:42 +01:00
_ctypes_test.h Copy ctypes-0.9.9.4 sources from external into the trunk. 2006-03-08 19:35:11 +00:00
callbacks.c [3.11] gh-105375: Improve error handling in _ctypes (GH-105593) (#105664) 2023-06-11 20:30:47 +00:00
callproc.c [3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638) 2022-11-21 11:22:10 +01:00
cfield.c gh-78878: Fix crash when creating an instance of _ctypes.CField (GH-14837) 2022-12-21 10:02:05 -08:00
ctypes.h [3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638) 2022-11-21 11:22:10 +01:00
ctypes_dlfcn.h Remove outdated PEP 291 compatibility requirement comment 2016-05-14 05:55:38 +00:00
malloc_closure.c [3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638) 2022-11-21 11:22:10 +01:00
stgdict.c [3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) (GH-113624) 2024-01-01 16:46:07 +00:00