mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
[3.8] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13891)
(cherry picked from commit dc2476500d
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
295fe32e39
commit
dd492d9c35
4 changed files with 29 additions and 4 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue