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)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 6982ddf..6538b36 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5271,6 +5271,8 @@
if (wp == NULL)
return;
+ cleanup_jumplist(wp, TRUE);
+
l = list_alloc();
if (l == NULL)
return;
@@ -5279,8 +5281,6 @@
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)