Skip to content

Commit cea7e26

Browse files
committed
add assert that Py_EMPTY_KEYS is immortal
1 parent 48a2b01 commit cea7e26

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/dictobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4854,6 +4854,7 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
48544854
d->ma_used = 0;
48554855
d->_ma_watcher_tag = 0;
48564856
// We don't inc ref empty keys because they're immortal
4857+
assert((Py_EMPTY_KEYS)->dk_refcnt == _Py_DICT_IMMORTAL_INITIAL_REFCNT);
48574858
d->ma_keys = Py_EMPTY_KEYS;
48584859
d->ma_values = NULL;
48594860
ASSERT_CONSISTENT(d);

0 commit comments

Comments
 (0)