File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -814,10 +814,12 @@ getarrayitem_locked(PyObject *op, Py_ssize_t i)
814814 }
815815#endif
816816 if (!valid_index (i , Py_SIZE (op ))) {
817- return NULL ;
817+ ret = NULL ;
818+ }
819+ else {
820+ arrayobject * ap = (arrayobject * )op ;
821+ ret = getarrayitem (op , i , ap -> ob_item );
818822 }
819- arrayobject * ap = (arrayobject * )op ;
820- ret = getarrayitem (op , i , ap -> ob_item );
821823 Py_END_CRITICAL_SECTION ();
822824 return ret ;
823825}
@@ -844,6 +846,8 @@ getarrayitem_maybe_locked(PyObject *op, Py_ssize_t i)
844846 return NULL ;
845847 }
846848 return getarrayitem (op , i , items );
849+ /* Could check size again here to make sure it hasn't changed during get,
850+ but not sure would add anything of value. */
847851}
848852
849853#else // Py_GIL_DISABLED
You can’t perform that action at this time.
0 commit comments