summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-13 14:56:38 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-13 14:56:38 (GMT)
commitd0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b (patch)
tree633b2e82a609b4142d7d7a84f8d37c55610e9d18 /Objects
parent9926480b6aaab60d2c5f710e7fc60061c52f6f08 (diff)
downloadcpython-d0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b.zip
cpython-d0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b.tar.gz
cpython-d0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b.tar.bz2
Fix _PyDict_Pop() on pending key
Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index bb5962a..06c54b5 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1721,7 +1721,7 @@ _PyDict_Pop(PyDictObject *mp, PyObject *key, PyObject *deflt)
ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
if (ix == DKIX_ERROR)
return NULL;
- if (ix == DKIX_EMPTY) {
+ if (ix == DKIX_EMPTY || *value_addr == NULL) {
if (deflt) {
Py_INCREF(deflt);
return deflt;