8000 fix · python/cpython@1c15fb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c15fb2

Browse files
committed
fix
1 parent 02560da
10000
 commit 1c15fb2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Objects/listobject.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -657,21 +657,18 @@ list_item(PyObject *aa, Py_ssize_t i)
657657
return NULL;
658658
}
659659
#ifdef Py_GIL_DISABLED
660+
if (!_Py_IsOwnedByCurrentThread((PyObject *)a) && !_PyObject_GC_IS_SHARED(a)) {
661+
_PyObject_GC_SET_SHARED(a);
662+
}
660663
PyObject **ob_item = _Py_atomic_load_ptr(&a->ob_item);
661664
item = _Py_atomic_load_ptr(&ob_item[i]);
662665
if (item && _Py_TryIncrefCompare(&ob_item[i], item)) {
663-
goto end;
666+
return item;
664667
}
665668
#endif
666669
Py_BEGIN_CRITICAL_SECTION(a);
667670
item = Py_NewRef(a->ob_item[i]);
668671
Py_END_CRITICAL_SECTION();
669-
#ifdef Py_GIL_DISABLED
670-
end:
671-
if (!_Py_IsOwnedByCurrentThread((PyObject *)a) && !_PyObject_GC_IS_SHARED(a)) {
672-
_PyObject_GC_SET_SHARED(a);
673-
}
674-
#endif
675672
return item;
676673
}
677674

0 commit comments

Comments
 (0)
0