Skip to content

Commit 816e22f

Browse files
committed
Use atomics for fetching type flags
1 parent 0a87264 commit 816e22f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Python/specialize.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,8 @@ specialize_attr_loadclassattr(PyObject *owner, _Py_CODEUNIT *instr,
15641564
}
15651565
#endif
15661566

1567-
if (owner_cls->tp_flags & Py_TPFLAGS_INLINE_VALUES) {
1567+
unsigned long tp_flags = PyType_GetFlags(owner_cls);
1568+
if (tp_flags & Py_TPFLAGS_INLINE_VALUES) {
15681569
#ifndef Py_GIL_DISABLED
15691570
PyDictKeysObject *keys = ((PyHeapTypeObject *)owner_cls)->ht_cached_keys;
15701571
assert(_PyDictKeys_StringLookup(keys, name) < 0);
@@ -1578,7 +1579,7 @@ specialize_attr_loadclassattr(PyObject *owner, _Py_CODEUNIT *instr,
15781579
}
15791580
else {
15801581
Py_ssize_t dictoffset;
1581-
if (owner_cls->tp_flags & Py_TPFLAGS_MANAGED_DICT) {
1582+
if (tp_flags & Py_TPFLAGS_MANAGED_DICT) {
15821583
dictoffset = MANAGED_DICT_OFFSET;
15831584
}
15841585
else {

0 commit comments

Comments
 (0)