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

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


https://hg.python.org/cpython/rev/d7b637af5a7e
changeset:   106405:d7b637af5a7e
branch:      3.5
parent:      106402:d7eb9526c4f4
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Feb 04 11:04:00 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