diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-04-23 17:44:32 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-04-23 17:44:32 (GMT) |
commit | db780d0d13976b099b22bc5145a53ec3ff6c63ba (patch) | |
tree | 0857fe4b93ec2419c47ae92fc0e75d0babaa8e4a /Objects | |
parent | 53b977127fe8192f8bdf6a400de81086e128e936 (diff) | |
download | cpython-db780d0d13976b099b22bc5145a53ec3ff6c63ba.zip cpython-db780d0d13976b099b22bc5145a53ec3ff6c63ba.tar.gz cpython-db780d0d13976b099b22bc5145a53ec3ff6c63ba.tar.bz2 |
fix instance dicts with str subclasses (#13903)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 2afbbae..51a8796 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -641,7 +641,11 @@ lookdict_split(PyDictObject *mp, PyObject *key, register PyDictKeyEntry *ep; if (!PyUnicode_CheckExact(key)) { - return lookdict(mp, key, hash, value_addr); + ep = lookdict(mp, key, hash, value_addr); + /* lookdict expects a combined-table, so fix value_addr */ + i = ep - ep0; + *value_addr = &mp->ma_values[i]; + return ep; } i = (size_t)hash & mask; ep = &ep0[i]; |