diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-13 16:56:38 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-13 16:56:38 +0200 |
commit | d0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b (patch) | |
tree | 633b2e82a609b4142d7d7a84f8d37c55610e9d18 /Objects/dictobject.c | |
parent | 9926480b6aaab60d2c5f710e7fc60061c52f6f08 (diff) | |
download | cpython-git-d0ad11f6b4b0c617b5b57f0dbc97a2a173f6309b.tar.gz |
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/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index bb5962a1a5..06c54b5665 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; |