mirror of https://github.com/python/cpython
gh-111178: Avoid calling long_hash from incompatible pointer type (GH-122972)
Make `long_hash` compatible with `hashfunc`.
This commit is contained in:
parent
05fc4d758a
commit
fe3e623562
|
@ -3614,8 +3614,9 @@ long_dealloc(PyObject *self)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Py_hash_t
|
static Py_hash_t
|
||||||
long_hash(PyLongObject *v)
|
long_hash(PyObject *obj)
|
||||||
{
|
{
|
||||||
|
PyLongObject *v = (PyLongObject *)obj;
|
||||||
Py_uhash_t x;
|
Py_uhash_t x;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
int sign;
|
int sign;
|
||||||
|
@ -6607,7 +6608,7 @@ PyTypeObject PyLong_Type = {
|
||||||
&long_as_number, /* tp_as_number */
|
&long_as_number, /* tp_as_number */
|
||||||
0, /* tp_as_sequence */
|
0, /* tp_as_sequence */
|
||||||
0, /* tp_as_mapping */
|
0, /* tp_as_mapping */
|
||||||
(hashfunc)long_hash, /* tp_hash */
|
long_hash, /* tp_hash */
|
||||||
0, /* tp_call */
|
0, /* tp_call */
|
||||||
0, /* tp_str */
|
0, /* tp_str */
|
||||||
PyObject_GenericGetAttr, /* tp_getattro */
|
PyObject_GenericGetAttr, /* tp_getattro */
|
||||||
|
|
Loading…
Reference in New Issue