summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-02-04 09:04:00 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-02-04 09:04:00 (GMT)
commitc7611362b425277da80b2397e0abedee58138996 (patch)
treeb1ba9e1e7303b9d23cb9517bdf3d50f7e798cd6a /Include
parent5702fb7b4d5adbeb82ec38d7d56ed339f7c90cc3 (diff)
downloadcpython-c7611362b425277da80b2397e0abedee58138996.zip
cpython-c7611362b425277da80b2397e0abedee58138996.tar.gz
cpython-c7611362b425277da80b2397e0abedee58138996.tar.bz2
Issue #27867: Silenced may-be-used-uninitialized warnings after
using PySlice_GetIndicesEx() in debug builds.
Diffstat (limited to 'Include')
-rw-r--r--Include/sliceobject.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 5359369..3626354 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -46,8 +46,9 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
- PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? -1 : \
- ((*slicelen = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
+ PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
+ ((*(slicelen) = 0), -1) : \
+ ((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
0))
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);