File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,18 @@ PyCell_GetRef(PyCellObject *cell)
4343 return res ;
4444}
4545
46- static inline
47- _PyStackRef _PyCell_GetStackRef (PyCellObject * cell )
46+ static inline _PyStackRef
47+ _PyCell_GetStackRef (PyCellObject * cell )
4848{
4949 PyObject * value ;
5050#ifdef Py_GIL_DISABLED
5151 value = _Py_atomic_load_ptr (& cell -> ob_ref );
52- if (value != NULL ) {
53- if (_Py_IsImmortal (value ) || _PyObject_HasDeferredRefcount (value )) {
54- return (_PyStackRef ){ .bits = (uintptr_t )value | Py_TAG_DEFERRED };
55- }
56- if (_Py_TryIncrefFast (value )) {
57- return _PyStackRef_FromPyObjectSteal (value );
58- }
52+ if (value == NULL ) {
53+ return PyStackRef_NULL ;
54+ }
55+ _PyStackRef ref ;
56+ if (_Py_TryIncrefCompareStackRef (& cell -> ob_ref , value , & ref )) {
57+ return ref ;
5958 }
6059#endif
6160 value = PyCell_GetRef (cell );
You can’t perform that action at this time.
0 commit comments