aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-12-26 08:02:54 +0800
committerGitHub <noreply@github.com>2021-12-25 19:02:54 -0500
commit06985fa595b5cd43e1a1b3a1b66198d4d0ae1c2f (patch)
tree7a14b4016b4c477b83befd86599b95b68990fc66
parent96230d6c69b5e9e04bb4d7cf54a1f48ba72f8790 (diff)
downloadrneovim-06985fa595b5cd43e1a1b3a1b66198d4d0ae1c2f.tar.gz
rneovim-06985fa595b5cd43e1a1b3a1b66198d4d0ae1c2f.tar.bz2
rneovim-06985fa595b5cd43e1a1b3a1b66198d4d0ae1c2f.zip
vim-patch:8.2.3883: crash when switching to other regexp engine fails (#16773)
Problem: Crash when switching to other regexp engine fails. Solution: Check for regprog being NULL. https://github.com/vim/vim/commit/5937c7505f444dd896f336fa0119a93a55ebe9a2
-rw-r--r--src/nvim/ex_cmds.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index c0cb17fa61..4965eb9c20 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4584,6 +4584,9 @@ void ex_global(exarg_T *eap)
// a match on this line?
match = vim_regexec_multi(&regmatch, curwin, curbuf, lnum,
(colnr_T)0, NULL, NULL);
+ if (regmatch.regprog == NULL) {
+ break; // re-compiling regprog failed
+ }
if ((type == 'g' && match) || (type == 'v' && !match)) {
ml_setmarked(lnum);
ndone++;