Commit de9d987e authored by Stefan Behnel's avatar Stefan Behnel

fix sign of return value in __Pyx_PyIndex_AsSsize_t() - looks like this isn't tested for

parent 4a7ec014
...@@ -324,7 +324,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { ...@@ -324,7 +324,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
{{for _case in (_size, -_size)}} {{for _case in (_size, -_size)}}
case {{_case}}: case {{_case}}:
if (8 * sizeof(Py_ssize_t) > {{_size}} * PyLong_SHIFT) { if (8 * sizeof(Py_ssize_t) > {{_size}} * PyLong_SHIFT) {
return (Py_ssize_t) {{pylong_join(_size, 'digits', 'size_t')}}; return {{'-' if _case < 0 else ''}}(Py_ssize_t) {{pylong_join(_size, 'digits', 'size_t')}};
} }
break; break;
{{endfor}} {{endfor}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment