[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #27867: Silenced may-be-used-uninitialized warnings after

serhiy.storchaka python-checkins at python.org
Sat Feb 4 04:08:29 EST 2017


https://hg.python.org/cpython/rev/b8fc4de84b9a
changeset:   106407:b8fc4de84b9a
branch:      3.6
parent:      106403:f49b6c35d1e3
parent:      106405:d7b637af5a7e
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Feb 04 11:07:17 2017 +0200
summary:
  Issue #27867: Silenced may-be-used-uninitialized warnings after
using PySlice_GetIndicesEx() in debug builds.

files:
  Include/sliceobject.h |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Include/sliceobject.h b/Include/sliceobject.h
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -46,8 +46,9 @@
 
 #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);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list