From 06985fa595b5cd43e1a1b3a1b66198d4d0ae1c2f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 Dec 2021 08:02:54 +0800 Subject: 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 --- src/nvim/ex_cmds.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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(®match, 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++; -- cgit