mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.2538: crash when using Python list iterator
Problem: Crash when using Python list iterator. Solution: Increment the list reference count. (closes #7886)
This commit is contained in:
@@ -2815,6 +2815,7 @@ typedef struct
|
||||
ListIterDestruct(listiterinfo_T *lii)
|
||||
{
|
||||
list_rem_watch(lii->list, &lii->lw);
|
||||
list_unref(lii->list);
|
||||
PyMem_Free(lii);
|
||||
}
|
||||
|
||||
@@ -2850,6 +2851,7 @@ ListIter(ListObject *self)
|
||||
list_add_watch(l, &lii->lw);
|
||||
lii->lw.lw_item = l->lv_first;
|
||||
lii->list = l;
|
||||
++l->lv_refcount;
|
||||
|
||||
return IterNew(lii,
|
||||
(destructorfun) ListIterDestruct, (nextfun) ListIterNext,
|
||||
|
Reference in New Issue
Block a user