diff --git a/Objects/setobject.c b/Objects/setobject.c index 478b5cb651d..48edad8a31a 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -365,11 +365,12 @@ set_add_entry(register PySetObject *so, setentry *entry) { register Py_ssize_t n_used; PyObject *key = entry->key; + Py_hash_t hash = entry->hash; assert(so->fill <= so->mask); /* at least one empty slot */ n_used = so->used; Py_INCREF(key); - if (set_insert_key(so, key, entry->hash) == -1) { + if (set_insert_key(so, key, hash) == -1) { Py_DECREF(key); return -1; } @@ -639,6 +640,7 @@ set_merge(PySetObject *so, PyObject *otherset) { PySetObject *other; PyObject *key; + Py_hash_t hash; register Py_ssize_t i; register setentry *entry; @@ -660,10 +662,11 @@ set_merge(PySetObject *so, PyObject *otherset) for (i = 0; i <= other->mask; i++) { entry = &other->table[i]; key = entry->key; + hash = entry->hash; if (key != NULL && key != dummy) { Py_INCREF(key); - if (set_insert_key(so, key, entry->hash) == -1) { + if (set_insert_key(so, key, hash) == -1) { Py_DECREF(key); return -1; }