diff src/evalfunc.c @ 15788:c24572e66556 v8.1.0901

patch 8.1.0901: index in getjumplist() may be wrong commit https://github.com/vim/vim/commit/57ee2b6e0b5b730d12ee9db00a8e2a577df9e374 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 12 22:15:06 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 12 Feb 2019 22:30:07 +0100
parents 5b6c3c7feba8
children 40336d427dd2
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5271,6 +5271,8 @@ f_getjumplist(typval_T *argvars, typval_
     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_
 	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)