diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-12 22:15:06 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-12 22:15:06 +0100 |
commit | 57ee2b6e0b5b730d12ee9db00a8e2a577df9e374 (patch) | |
tree | 7a464fd4a90cd0a52e0329bb01aea5280b27ac7a /src/evalfunc.c | |
parent | 48773f1f83e666c49b9d88ea6a392d50215ca013 (diff) |
patch 8.1.0901: index in getjumplist() may be wrongv8.1.0901
Problem: Index in getjumplist() may be wrong. (Epheien)
Solution: Call cleanup_jumplist() earlier. (Yegappan Lakshmanan,
closes #3941)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 6982ddfe1a..6538b36d3c 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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) |