Guido van Rossum added the comment:
Oops, the same code appeared twice. The new fix fixes both places.
Added file: http://bugs.python.org/file8827/fix1517.diff
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1517>
__________________________________
Index: Objects/dictobject.c
===================================================================
--- Objects/dictobject.c (revision 59221)
+++ Objects/dictobject.c (working copy)
@@ -272,7 +272,9 @@
else {
if (ep->me_hash == hash) {
startkey = ep->me_key;
+ Py_INCREF(startkey);
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
+ Py_DECREF(startkey);
if (cmp < 0)
return NULL;
if (ep0 == mp->ma_table && ep->me_key == startkey) {
@@ -302,7 +304,9 @@
return ep;
if (ep->me_hash == hash && ep->me_key != dummy) {
startkey = ep->me_key;
+ Py_INCREF(startkey);
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
+ Py_DECREF(startkey);
if (cmp < 0)
return NULL;
if (ep0 == mp->ma_table && ep->me_key == startkey) {
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com