[Python-checkins] r63806 - python/trunk/Objects/setobject.c

raymond.hettinger python-checkins at python.org
Fri May 30 08:49:47 CEST 2008


Author: raymond.hettinger
Date: Fri May 30 08:49:47 2008
New Revision: 63806

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

Modified:
   python/trunk/Objects/setobject.c

Modified: python/trunk/Objects/setobject.c
==============================================================================
--- python/trunk/Objects/setobject.c	(original)
+++ python/trunk/Objects/setobject.c	Fri May 30 08:49:47 2008
@@ -94,7 +94,9 @@
 	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 @@
 			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) {


More information about the Python-checkins mailing list