Skip to content

Commit 9fda5db

Browse files
committed
Use thread-safe version of _PyDictKeys_StringLookup
1 parent ecfd199 commit 9fda5db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/specialize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,8 @@ specialize_inline_values_access_lock_held(
976976
_PyAttrCache *cache = (_PyAttrCache *)(instr + 1);
977977
assert(PyUnicode_CheckExact(name));
978978
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(owner);
979-
Py_ssize_t index = _PyDictKeys_StringLookup(keys, name);
979+
uint32_t version;
980+
Py_ssize_t index = _PyDictKeys_StringLookupAndVersion(keys, name, &version);
980981
assert (index != DKIX_ERROR);
981982
if (index == DKIX_EMPTY) {
982983
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_NOT_IN_KEYS);

0 commit comments

Comments
 (0)