]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #27867: Silenced may-be-used-uninitialized warnings after
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Feb 2017 09:04:00 +0000 (11:04 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Feb 2017 09:04:00 +0000 (11:04 +0200)
using PySlice_GetIndicesEx() in debug builds.

Include/sliceobject.h

index 535936901268c4f5af32910f6c3acf0732a77f00..36263544607096986b56c27043ef65f4e9b7bda4 100644 (file)
@@ -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);