bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860)

This commit is contained in:
Zackery Spytz 2019-06-06 14:39:23 -06:00 committed by Victor Stinner
parent f6713e84af
commit dc2476500d
4 changed files with 29 additions and 4 deletions

View file

@ -1376,7 +1376,7 @@ _PyLong_AsUnsignedLongLongMask(PyObject *vv)
if (vv == NULL || !PyLong_Check(vv)) {
PyErr_BadInternalCall();
return (unsigned long) -1;
return (unsigned long long) -1;
}
v = (PyLongObject *)vv;
switch(Py_SIZE(v)) {
@ -1404,7 +1404,7 @@ PyLong_AsUnsignedLongLongMask(PyObject *op)
if (op == NULL) {
PyErr_BadInternalCall();
return (unsigned long)-1;
return (unsigned long long)-1;
}
if (PyLong_Check(op)) {