0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.1.0901: index in getjumplist() may be wrong

Problem:    Index in getjumplist() may be wrong. (Epheien)
Solution:   Call cleanup_jumplist() earlier. (Yegappan Lakshmanan,
            closes #3941)
This commit is contained in:
Bram Moolenaar
2019-02-12 22:15:06 +01:00
parent 48773f1f83
commit 57ee2b6e0b
3 changed files with 14 additions and 8 deletions

View File

@@ -5271,6 +5271,8 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
if (wp == NULL)
return;
cleanup_jumplist(wp, TRUE);
l = list_alloc();
if (l == NULL)
return;
@@ -5279,8 +5281,6 @@ f_getjumplist(typval_T *argvars, typval_T *rettv)
return;
list_append_number(rettv->vval.v_list, (varnumber_T)wp->w_jumplistidx);
cleanup_jumplist(wp, TRUE);
for (i = 0; i < wp->w_jumplistlen; ++i)
{
if (wp->w_jumplist[i].fmark.mark.lnum == 0)