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.
5937c7505f
This commit is contained in:
zeertzjq 2021-12-26 08:02:54 +08:00 committed by GitHub
parent 96230d6c69
commit 06985fa595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++;