]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766)
authorDiego Russo <diego.russo@arm.com>
Wed, 6 Dec 2023 15:57:42 +0000 (15:57 +0000)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2023 15:57:42 +0000 (16:57 +0100)
commitb49c963e85f5a82822983c20be93790d71cbc408
treec88e778cea8b2a4b4f8dd4501bc679703220ee76
parent010819a29552eca7020e497e86c7a0bc28bba46a
[3.11] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112766)

Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms.
This because on Arm platforms structs with at most 4 elements of any
floating point type values can be passed through registers. If the type
is double the maximum size of the struct is 32 bytes.
On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate.

(cherry picked from commit bc68f4a4abcfbea60bb1db1ccadb07613561931c)
Lib/ctypes/test/test_structures.py
Misc/NEWS.d/next/Library/2023-12-01-18-05-09.gh-issue-110190.5bf-c9.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes_test.c
Modules/_ctypes/stgdict.c