diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2021-04-22 15:34:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 15:34:57 (GMT) |
commit | a07da09ad5bd7d234ccd084a3a0933c290d1b592 (patch) | |
tree | 8c1ab67575527bd5c0c9452a74458ad5a29a1d08 /Objects | |
parent | accea7dc2bd30a6e8e1b0334acfca9585cbd7f8a (diff) | |
download | cpython-a07da09ad5bd7d234ccd084a3a0933c290d1b592.zip cpython-a07da09ad5bd7d234ccd084a3a0933c290d1b592.tar.gz cpython-a07da09ad5bd7d234ccd084a3a0933c290d1b592.tar.bz2 |
bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/complexobject.c | 4 | ||||
-rw-r--r-- | Objects/floatobject.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index a65ebdf..91e06a8 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -412,10 +412,10 @@ static Py_hash_t complex_hash(PyComplexObject *v) { Py_uhash_t hashreal, hashimag, combined; - hashreal = (Py_uhash_t)_Py_HashDouble(v->cval.real); + hashreal = (Py_uhash_t)_Py_HashDouble((PyObject *) v, v->cval.real); if (hashreal == (Py_uhash_t)-1) return -1; - hashimag = (Py_uhash_t)_Py_HashDouble(v->cval.imag); + hashimag = (Py_uhash_t)_Py_HashDouble((PyObject *)v, v->cval.imag); if (hashimag == (Py_uhash_t)-1) return -1; /* Note: if the imaginary part is 0, hashimag is 0 now, diff --git a/Objects/floatobject.c b/Objects/floatobject.c index b3c41b1..7e78132 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -556,7 +556,7 @@ float_richcompare(PyObject *v, PyObject *w, int op) static Py_hash_t float_hash(PyFloatObject *v) { - return _Py_HashDouble(v->ob_fval); + return _Py_HashDouble((PyObject *)v, v->ob_fval); } static PyObject * |