Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Objects/listobject.c
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
  • Loading branch information
eendebakpt and corona10 authored Jul 8, 2022
commit 1512885e242707ba2aa84346e410316d61bc5730
5 changes: 3 additions & 2 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,9 @@ list_pop_impl(PyListObject *self, Py_ssize_t index)
memmove(&items[index], &items[index+1], (Py_SIZE(self)-1-index)* sizeof(PyObject *));
status = list_resize(self, Py_SIZE(self) - 1);
}
if (status >= 0)
return v; /* and v now owns the reference the list had */
if (status >= 0) {
return v; // and v now owns the reference the list had
}
else {
// list resize failed, need to restore
memmove(&items[index+1], &items[index], (Py_SIZE(self)-1-index)* sizeof(PyObject *));
Expand Down