mirror of https://github.com/python/cpython
fix dict gc tracking (#13903)
This commit is contained in:
parent
01296da8df
commit
7ce67e45f8
|
@ -2022,6 +2022,8 @@ PyDict_Copy(PyObject *o)
|
|||
Py_XINCREF(value);
|
||||
split_copy->ma_values[i] = value;
|
||||
}
|
||||
if (_PyObject_GC_IS_TRACKED(mp))
|
||||
_PyObject_GC_TRACK(split_copy);
|
||||
return (PyObject *)split_copy;
|
||||
}
|
||||
copy = PyDict_New();
|
||||
|
@ -2220,6 +2222,7 @@ dict_setdefault(register PyDictObject *mp, PyObject *args)
|
|||
return NULL;
|
||||
ep = find_empty_slot(mp, key, hash, &value_addr);
|
||||
}
|
||||
MAINTAIN_TRACKING(mp, key, failobj);
|
||||
ep->me_key = key;
|
||||
ep->me_hash = hash;
|
||||
*value_addr = failobj;
|
||||
|
|
Loading…
Reference in New Issue