mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #27214: Fix potential bug and remove useless optimization in long_invert. Thanks Oren Milman.
This commit is contained in:
parent
2be278c70c
commit
583c6e860c
2 changed files with 8 additions and 2 deletions
|
@ -4170,8 +4170,10 @@ long_invert(PyLongObject *v)
|
|||
Py_DECREF(w);
|
||||
if (x == NULL)
|
||||
return NULL;
|
||||
Py_SIZE(x) = -(Py_SIZE(x));
|
||||
return (PyObject *)maybe_small_long(x);
|
||||
_PyLong_Negate(&x);
|
||||
/* No need for maybe_small_long here, since any small
|
||||
longs will have been caught in the Py_SIZE <= 1 fast path. */
|
||||
return (PyObject *)x;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue