Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c15fb2

Browse filesBrowse files
committed
fix
1 parent 02560da commit 1c15fb2
Copy full SHA for 1c15fb2

File tree

Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed

‎Objects/listobject.c

Copy file name to clipboardExpand all lines: Objects/listobject.c
+4-7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.