comparison src/screen.c @ 6394:5f49ac8426df v7.4.528

updated for version 7.4.528 Problem: Crash when using matchadd() (Yasuhiro Matsumoto) Solution: Copy the match regprog.
author Bram Moolenaar <bram@vim.org>
date Thu, 27 Nov 2014 13:37:10 +0100
parents 93560d4bca68
children d2239abd3edb
comparison
equal deleted inserted replaced
6393:661e95466448 6394:5f49ac8426df
7586 matchcol = shl->rm.endpos[0].col; 7586 matchcol = shl->rm.endpos[0].col;
7587 7587
7588 shl->lnum = lnum; 7588 shl->lnum = lnum;
7589 if (shl->rm.regprog != NULL) 7589 if (shl->rm.regprog != NULL)
7590 { 7590 {
7591 /* Remember whether shl->rm is using a copy of the regprog in
7592 * cur->match. */
7593 int regprog_is_copy = (shl != &search_hl && cur != NULL
7594 && shl == &cur->hl
7595 && cur->match.regprog == cur->hl.rm.regprog);
7596
7591 nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, 7597 nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
7592 matchcol, 7598 matchcol,
7593 #ifdef FEAT_RELTIME 7599 #ifdef FEAT_RELTIME
7594 &(shl->tm) 7600 &(shl->tm)
7595 #else 7601 #else
7596 NULL 7602 NULL
7597 #endif 7603 #endif
7598 ); 7604 );
7605 /* Copy the regprog, in case it got freed and recompiled. */
7606 if (regprog_is_copy)
7607 cur->match.regprog = cur->hl.rm.regprog;
7608
7599 if (called_emsg || got_int) 7609 if (called_emsg || got_int)
7600 { 7610 {
7601 /* Error while handling regexp: stop using this regexp. */ 7611 /* Error while handling regexp: stop using this regexp. */
7602 if (shl == &search_hl) 7612 if (shl == &search_hl)
7603 { 7613 {