summaryrefslogtreecommitdiff
path: root/numpy/core/include
diff options
context:
space:
mode:
authorMarten van Kerkwijk <mhvk@astro.utoronto.ca>2018-06-08 11:44:17 -0400
committerGitHub <noreply@github.com>2018-06-08 11:44:17 -0400
commitccb2a712ab55a34b26b06bfd325020af3889b00c (patch)
tree9eb59ad9d313c9c1490e19682280d1820028902a /numpy/core/include
parentda5eaf97281453083252c22b2b94aded846a936b (diff)
parent95c1e49c64ebb7a60dae7355a9f37d1cefef9cc6 (diff)
downloadnumpy-ccb2a712ab55a34b26b06bfd325020af3889b00c.tar.gz
Merge pull request #11155 from eric-wieser/datetime-stack-overflow
BUG: Prevent stackoverflow in conversion to datetime types
Diffstat (limited to 'numpy/core/include')
-rw-r--r--numpy/core/include/numpy/npy_3kcompat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h
index 56fbd99af..2d0ccd3b9 100644
--- a/numpy/core/include/numpy/npy_3kcompat.h
+++ b/numpy/core/include/numpy/npy_3kcompat.h
@@ -61,6 +61,14 @@ static NPY_INLINE int PyInt_Check(PyObject *op) {
PySlice_GetIndicesEx((PySliceObject *)op, nop, start, end, step, slicelength)
#endif
+/* <2.7.11 and <3.4.4 have the wrong argument type for Py_EnterRecursiveCall */
+#if (PY_VERSION_HEX < 0x02070B00) || \
+ ((0x03000000 <= PY_VERSION_HEX) && (PY_VERSION_HEX < 0x03040400))
+ #define Npy_EnterRecursiveCall(x) Py_EnterRecursiveCall((char *)(x))
+#else
+ #define Npy_EnterRecursiveCall(x) Py_EnterRecursiveCall(x)
+#endif
+
/*
* PyString -> PyBytes
*/