From a6707f5791ddfa3872fa22bc2c384847976d2fee Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 17 Jun 2019 23:22:26 -0400 Subject: vim-patch:8.1.0073: crash when autocommands call setloclist() Problem: Crash when autocommands call setloclist(). (Dominique Pelle) Solution: If the quickfix list changes then don't jump to the error. https://github.com/vim/vim/commit/0366c0161e988e32420d2f37111a60129684905b --- src/nvim/quickfix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 0e4fa0afc6..304df6f99b 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -5368,8 +5368,11 @@ void ex_cexpr(exarg_T *eap) apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)au_name, curbuf->b_fname, true, curbuf); } - if (res > 0 && (eap->cmdidx == CMD_cexpr || eap->cmdidx == CMD_lexpr)) { - qf_jump(qi, 0, 0, eap->forceit); // display first error + if (res > 0 + && (eap->cmdidx == CMD_cexpr || eap->cmdidx == CMD_lexpr) + && qi == ll_get_or_alloc_list(curwin)) { + // Jump to the first error if autocmds didn't free the list. + qf_jump(qi, 0, 0, eap->forceit); } } else { EMSG(_("E777: String or List expected")); -- cgit From 5c2feb690e5b694a268566d1e168cf53ee4fda8d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 17 Jun 2019 23:24:54 -0400 Subject: vim-patch:8.1.0074: crash when running quickfix tests Problem: Crash when running quickfix tests. Solution: Do not alloc a new location list when checking for the reference to be still valid. https://github.com/vim/vim/commit/d6b01a2d3884ee0abe10aad161f584889a496e3f --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 304df6f99b..3c744310b3 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -5370,7 +5370,7 @@ void ex_cexpr(exarg_T *eap) } if (res > 0 && (eap->cmdidx == CMD_cexpr || eap->cmdidx == CMD_lexpr) - && qi == ll_get_or_alloc_list(curwin)) { + && qi == GET_LOC_LIST(curwin)) { // Jump to the first error if autocmds didn't free the list. qf_jump(qi, 0, 0, eap->forceit); } -- cgit