From 522a60c10d4a0dde3b1e7c0b90c430105e07d34f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 4 Feb 2017 11:04:00 +0200 Subject: Issue #27867: Silenced may-be-used-uninitialized warnings after using PySlice_GetIndicesEx() in debug builds. --- Include/sliceobject.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Include/sliceobject.h b/Include/sliceobject.h index 0405eda..445a8d8 100644 --- a/Include/sliceobject.h +++ b/Include/sliceobject.h @@ -39,8 +39,9 @@ PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length, Py_ssize_t *step, Py_ssize_t *slicelength); #define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \ - _PySlice_Unpack((PyObject *)(slice), (start), (stop), (step)) < 0 ? -1 : \ - ((*slicelen = _PySlice_AdjustIndices((length), (start), (stop), *(step))), \ + _PySlice_Unpack((PyObject *)(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); -- cgit v0.12