diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-02-04 11:04:00 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-02-04 11:04:00 +0200 |
commit | f33994ff67ea221a49cfad06338d2d6758ae4d89 (patch) | |
tree | ddc137a33971be0bf56669ca59edd0a841e37bdf | |
parent | acbb71ea58f932980f795e7582309fc2b33490eb (diff) | |
download | cpython-f33994ff67ea221a49cfad06338d2d6758ae4d89.tar.gz |
Issue #27867: Silenced may-be-used-uninitialized warnings after
using PySlice_GetIndicesEx() in debug builds.
-rw-r--r-- | Include/sliceobject.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h index 5359369012..3626354460 100644 --- a/Include/sliceobject.h +++ b/Include/sliceobject.h @@ -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); |