mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
- Issue #3537: Fix an assertion failure when an empty but presized dict
object was stored in the freelist.
This commit is contained in:
parent
14646337bf
commit
1e13ea94a3
3 changed files with 18 additions and 0 deletions
|
@ -241,6 +241,10 @@ PyDict_New(void)
|
|||
_Py_NewReference((PyObject *)mp);
|
||||
if (mp->ma_fill) {
|
||||
EMPTY_TO_MINSIZE(mp);
|
||||
} else {
|
||||
/* At least set ma_table and ma_mask; these are wrong
|
||||
if an empty but presized dict is added to freelist */
|
||||
INIT_NONZERO_DICT_SLOTS(mp);
|
||||
}
|
||||
assert (mp->ma_used == 0);
|
||||
assert (mp->ma_table == mp->ma_smalltable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue