Issue 2855: Fix obscure crasher by slowing down the entire module. Mimics what was done to dictionaries in r59223.

This commit is contained in:
Raymond Hettinger 2008-05-30 06:49:47 +00:00
parent 65856600ed
commit d99bee7c9f

View file

@ -94,7 +94,9 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
else {
if (entry->hash == hash) {
startkey = entry->key;
Py_INCREF(startkey);
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
Py_DECREF(startkey);
if (cmp < 0)
return NULL;
if (table == so->table && entry->key == startkey) {
@ -125,7 +127,9 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
break;
if (entry->hash == hash && entry->key != dummy) {
startkey = entry->key;
Py_INCREF(startkey);
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
Py_DECREF(startkey);
if (cmp < 0)
return NULL;
if (table == so->table && entry->key == startkey) {