From: Serhiy Storchaka Date: Sat, 4 Feb 2017 09:04:00 +0000 (+0200) Subject: Issue #27867: Silenced may-be-used-uninitialized warnings after X-Git-Tag: v2.7.14rc1~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=522a60c10d4a0dde3b1e7c0b90c430105e07d34f;p=thirdparty%2FPython%2Fcpython.git Issue #27867: Silenced may-be-used-uninitialized warnings after using PySlice_GetIndicesEx() in debug builds. --- diff --git a/Include/sliceobject.h b/Include/sliceobject.h index 0405edad4d44..445a8d87e021 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);