mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.4.528
Problem: Crash when using matchadd() (Yasuhiro Matsumoto) Solution: Copy the match regprog.
This commit is contained in:
10
src/screen.c
10
src/screen.c
@@ -7588,6 +7588,12 @@ next_search_hl(win, shl, lnum, mincol, cur)
|
|||||||
shl->lnum = lnum;
|
shl->lnum = lnum;
|
||||||
if (shl->rm.regprog != NULL)
|
if (shl->rm.regprog != NULL)
|
||||||
{
|
{
|
||||||
|
/* Remember whether shl->rm is using a copy of the regprog in
|
||||||
|
* cur->match. */
|
||||||
|
int regprog_is_copy = (shl != &search_hl && cur != NULL
|
||||||
|
&& shl == &cur->hl
|
||||||
|
&& cur->match.regprog == cur->hl.rm.regprog);
|
||||||
|
|
||||||
nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
|
nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
|
||||||
matchcol,
|
matchcol,
|
||||||
#ifdef FEAT_RELTIME
|
#ifdef FEAT_RELTIME
|
||||||
@@ -7596,6 +7602,10 @@ next_search_hl(win, shl, lnum, mincol, cur)
|
|||||||
NULL
|
NULL
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
/* Copy the regprog, in case it got freed and recompiled. */
|
||||||
|
if (regprog_is_copy)
|
||||||
|
cur->match.regprog = cur->hl.rm.regprog;
|
||||||
|
|
||||||
if (called_emsg || got_int)
|
if (called_emsg || got_int)
|
||||||
{
|
{
|
||||||
/* Error while handling regexp: stop using this regexp. */
|
/* Error while handling regexp: stop using this regexp. */
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
528,
|
||||||
/**/
|
/**/
|
||||||
527,
|
527,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user