summaryrefslogtreecommitdiff
path: root/367.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-02-04 07:56:39 +0000
committerCoprDistGit <infra@openeuler.org>2025-02-04 07:56:39 +0000
commit8c1cbe25d38ba9198be10751231aac93089916b1 (patch)
tree4946ca8a80bb5839dcd19829c6b3f52dbba753fb /367.patch
parent40c70d2d420426025bf282e2b023b9cb47233ec6 (diff)
automatic import of pygobject3openeuler24.03_LTS_SP1openeuler24.03_LTS
Diffstat (limited to '367.patch')
-rw-r--r--367.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/367.patch b/367.patch
new file mode 100644
index 0000000..8306c6f
--- /dev/null
+++ b/367.patch
@@ -0,0 +1,42 @@
+From a2445df58a712980ccd0c21d75a631c6bda89b2b Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Wed, 23 Oct 2024 12:01:24 +0100
+Subject: [PATCH] async: Use correct T_BOOL type for _asyncio_future_blocking
+
+Declaring a PyMemberDef with type T_BOOL requires the corresponding C
+type to be char, with value 0 or 1: when the member is read, CPython
+will effectively be dereferencing
+`* (char *) &pygiasync._asyncio_future_blocking`.
+
+On little-endian architectures, in practice this worked, because the
+low-order bits of an int are in the first byte, which would take value
+0 or 1 as desired, with all other bits zero. However, on big-endian
+architectures, the low-order bits of an int are in the last byte, so
+reading the _asyncio_future_blocking attribute from Python code would
+in practice always produce 0, even when the int field had been set to 1
+from C code.
+
+Reference: https://docs.python.org/3/c-api/structures.html#member-types
+Resolves: https://gitlab.gnome.org/GNOME/pygobject/-/issues/650
+Bug-Debian: https://bugs.debian.org/1085891
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ gi/pygi-async.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gi/pygi-async.h b/gi/pygi-async.h
+index d5e7a92a7..341d62377 100644
+--- a/gi/pygi-async.h
++++ b/gi/pygi-async.h
+@@ -37,7 +37,7 @@ typedef struct {
+ PyGICallableInfo *finish_func;
+ PyObject *loop;
+ PyObject *cancellable;
+- int _asyncio_future_blocking;
++ char _asyncio_future_blocking;
+ PyObject *result;
+ PyObject *exception;
+
+--
+GitLab
+