[Python-checkins] r59223 - python/trunk/Objects/dictobject.c
guido.van.rossum
python-checkins at python.org
Thu Nov 29 19:25:12 CET 2007
Author: guido.van.rossum
Date: Thu Nov 29 19:25:12 2007
New Revision: 59223
Modified:
python/trunk/Objects/dictobject.c
Log:
Fix bug #1517, a segfault in lookdict().
Modified: python/trunk/Objects/dictobject.c
==============================================================================
--- python/trunk/Objects/dictobject.c (original)
+++ python/trunk/Objects/dictobject.c Thu Nov 29 19:25:12 2007
@@ -270,7 +270,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) {
@@ -300,7 +302,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) {
More information about the Python-checkins
mailing list