Skip to content

Commit 95de67f

Browse files
committed
Update Cython patch to avoid direct access to PyComplex.cval
1 parent 34de53f commit 95de67f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

graalpython/lib-graalpython/patches/Cython/Cython-0.29.32.patch

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ index 202dea7..1e83e66 100644
111111
# Extract the start, stop and step data members from a slice object as C
112112
# integers. Silently reduce values larger than PY_SSIZE_T_MAX to
113113
# PY_SSIZE_T_MAX, silently boost the start and stop values less than
114+
diff --git a/Cython/Utility/Complex.c b/Cython/Utility/Complex.c
115+
index 28062a0..c51d6bc 100644
116+
--- a/Cython/Utility/Complex.c
117+
+++ b/Cython/Utility/Complex.c
118+
@@ -102,7 +102,7 @@ static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject*);
119+
120+
static {{type}} __Pyx_PyComplex_As_{{type_name}}(PyObject* o) {
121+
Py_complex cval;
122+
-#if !CYTHON_COMPILING_IN_PYPY
123+
+#if !CYTHON_COMPILING_IN_PYPY && !defined(GRAALVM_PYTHON)
124+
if (PyComplex_CheckExact(o))
125+
cval = ((PyComplexObject *)o)->cval;
126+
else
114127
diff --git a/Cython/Utility/Coroutine.c b/Cython/Utility/Coroutine.c
115128
index 474e6d2..4aeb19c 100644
116129
--- a/Cython/Utility/Coroutine.c
@@ -196,7 +209,7 @@ index f8bf885..94d0ca6 100644
196209
main_interpreter_id = current_id;
197210
return (unlikely(current_id == -1)) ? -1 : 0;
198211
diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c
199-
index 864b658..119f363 100644
212+
index 6e7153c..6d766a1 100644
200213
--- a/Cython/Utility/ObjectHandling.c
201214
+++ b/Cython/Utility/ObjectHandling.c
202215
@@ -717,7 +717,7 @@ bad:

0 commit comments

Comments
 (0)