From 5937c7505f444dd896f336fa0119a93a55ebe9a2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 24 Dec 2021 16:46:14 +0000 Subject: [PATCH] patch 8.2.3883: crash when switching to other regexp engine fails Problem: Crash when switching to other regexp engine fails. Solution: Check for regprog being NULL. --- src/ex_cmds.c | 2 ++ src/version.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 10c8e617c9a11..14045267da0c8 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -4975,6 +4975,8 @@ 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); diff --git a/src/version.c b/src/version.c index a77aa046f346d..05b8120a98c7f 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3883, /**/ 3882, /**/