Skip to content

Commit f3bb792

Browse files
committed
avoid setting dk_log2_index_bytes
1 parent 52bf468 commit f3bb792

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ new_keys_object(uint8_t log2_size, bool unicode)
780780
dk = _Py_FREELIST_POP_MEM(dictkeys);
781781
assert(dk->dk_log2_size == log2_size);
782782
assert(dk->dk_kind == DICT_KEYS_UNICODE);
783+
assert(dk->dk_log2_index_bytes == log2_bytes);
783784
}
784785
if (dk == NULL) {
785786
dk = PyMem_Malloc(sizeof(PyDictKeysObject)
@@ -791,12 +792,12 @@ new_keys_object(uint8_t log2_size, bool unicode)
791792
}
792793
dk->dk_log2_size = log2_size;
793794
dk->dk_kind = unicode ? DICT_KEYS_UNICODE : DICT_KEYS_GENERAL;
795+
dk->dk_log2_index_bytes = log2_bytes;
794796
}
795797
#ifdef Py_REF_DEBUG
796798
_Py_IncRefTotal(_PyThreadState_GET());
797799
#endif
798800
dk->dk_refcnt = 1;
799-
dk->dk_log2_index_bytes = log2_bytes;
800801
#ifdef Py_GIL_DISABLED
801802
dk->dk_mutex = (PyMutex){0};
802803
#endif

0 commit comments

Comments
 (0)