https://github.com/python/cpython/commit/f15fff3f13431385b64837a2a69bf68924195ec2
commit: f15fff3f13431385b64837a2a69bf68924195ec2
branch: main
author: Jakub KulĂ­k <[email protected]>
committer: encukou <[email protected]>
date: 2024-09-17T19:06:53+02:00
summary:

gh-110190: Fix ctypes structs with array on SPARC (GH-118233)

files:
A Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst
M Modules/_ctypes/stgdict.c

diff --git 
a/Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst 
b/Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst
new file mode 100644
index 00000000000000..abc3ddb4ab5597
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-04-24-16-23-04.gh-issue-110190.TGd5qx.rst
@@ -0,0 +1,2 @@
+Fix ctypes structs with array on SPARC by setting ``MAX_STRUCT_SIZE`` to 32
+in stgdict. Patch by Jakub Kulik
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index c9cd1c6e7381f6..5dbbe0b3285d58 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -433,7 +433,7 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject 
*fields, int isStruct
 /*
  * The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
  */
-#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
+#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64) || 
defined(__sparc__)
 #  define MAX_STRUCT_SIZE 32
 #elif defined(__powerpc64__)
 #  define MAX_STRUCT_SIZE 64

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to