summaryrefslogtreecommitdiff
path: root/Include/sliceobject.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-02-04 11:08:04 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-02-04 11:08:04 +0200
commit8973de5babfefe5858488aba6d5d730bc217b0f8 (patch)
tree5c5202c696db80902c3564450c0f54047f0e3b48 /Include/sliceobject.h
parent09f939d2c4485f43ae50fc04f9ba439da850bd93 (diff)
parented4de13f0607c41d953269375d45af3f5f3979a4 (diff)
downloadcpython-git-8973de5babfefe5858488aba6d5d730bc217b0f8.tar.gz
Issue #27867: Silenced may-be-used-uninitialized warnings after
using PySlice_GetIndicesEx() in debug builds.
Diffstat (limited to 'Include/sliceobject.h')
-rw-r--r--Include/sliceobject.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index edd14c5c7d..b24f2926f1 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);