summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-11-29 18:43:05 (GMT)
committerGuido van Rossum <guido@python.org>2007-11-29 18:43:05 (GMT)
commit2fd4f37f11420ab2a010cb057ffb15d37a9504cb (patch)
tree9f3f3f66c014993d962156e5ed0a27f616ac01f0 /Objects
parent5c10664043448f1d27d7ce7eb67c2afe3f54b018 (diff)
downloadcpython-2fd4f37f11420ab2a010cb057ffb15d37a9504cb.zip
cpython-2fd4f37f11420ab2a010cb057ffb15d37a9504cb.tar.gz
cpython-2fd4f37f11420ab2a010cb057ffb15d37a9504cb.tar.bz2
Merged revisions 59212-59225 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59218 | georg.brandl | 2007-11-29 09:01:20 -0800 (Thu, 29 Nov 2007) | 2 lines Fix reference target. ........ r59219 | georg.brandl | 2007-11-29 09:02:34 -0800 (Thu, 29 Nov 2007) | 4 lines Add examples to the ConfigParser documentation. Credits go to Thomas Lamb, who wrote this as a task in the GHOP contest. ........ r59223 | guido.van.rossum | 2007-11-29 10:25:12 -0800 (Thu, 29 Nov 2007) | 2 lines Fix bug #1517, a segfault in lookdict(). ........ r59224 | georg.brandl | 2007-11-29 10:33:01 -0800 (Thu, 29 Nov 2007) | 2 lines Spaces vs. Tabs. ........
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index b849f57..d1ebf1f 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -270,7 +270,9 @@ lookdict(PyDictObject *mp, PyObject *key, register long hash)
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 @@ lookdict(PyDictObject *mp, PyObject *key, register long hash)
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) {