diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-23 21:29:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-23 21:29:48 +0200 |
commit | 3b9474b4ad4d85b5396f7f641b436f193dc9d486 (patch) | |
tree | 32e8c88604f6da2d38708363437f760732444462 /src/quickfix.c | |
parent | 6537c421bb626ee92a2487a543e6287d33461bd0 (diff) | |
download | vim-git-3b9474b4ad4d85b5396f7f641b436f193dc9d486.tar.gz |
patch 8.0.1750: crash when clearing loccation list in autocommandv8.0.1750
Problem: Crash when clearing loccation list in autocommand.
Solution: Check if "qi" equals "ql_info". (Yegappan Lakshmanan)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 39e3913c0..6142825e3 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -5897,7 +5897,6 @@ ex_helpgrep(exarg_T *eap) char_u *lang; #endif qf_info_T *qi = &ql_info; - qf_info_T *save_qi; int new_qi = FALSE; win_T *wp; char_u *au_name = NULL; @@ -5951,9 +5950,6 @@ ex_helpgrep(exarg_T *eap) } } - /* Autocommands may change the list. Save it for later comparison */ - save_qi = qi; - regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING); regmatch.rm_ic = FALSE; if (regmatch.regprog != NULL) @@ -6086,7 +6082,7 @@ ex_helpgrep(exarg_T *eap) { apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, curbuf->b_fname, TRUE, curbuf); - if (!new_qi && qi != save_qi && qf_find_buf(qi) == NULL) + if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL) /* autocommands made "qi" invalid */ return; } |