Permalink
Browse files

updated for version 7.4.253

Problem:    Crash when using cpp syntax file with pattern using external
            match. (Havard Garnes)
Solution:   Discard match when end column is before start column.
  • Loading branch information...
brammool committed Apr 6, 2014
1 parent 7bcdb7d commit 5a4e160ce423f56456227c3d7d8d8a069120b377
Showing with 8 additions and 3 deletions.
  1. +2 −1 src/regexp.c
  2. +4 −2 src/regexp_nfa.c
  3. +2 −0 src/version.c
@@ -4146,7 +4146,8 @@ regtry(prog, col)
{
/* Only accept single line matches. */
if (reg_startzpos[i].lnum >= 0
&& reg_endzpos[i].lnum == reg_startzpos[i].lnum)
&& reg_endzpos[i].lnum == reg_startzpos[i].lnum
&& reg_endzpos[i].col >= reg_startzpos[i].col)
re_extmatch_out->matches[i] =
vim_strnsave(reg_getline(reg_startzpos[i].lnum)
+ reg_startzpos[i].col,
@@ -6781,8 +6781,10 @@ nfa_regtry(prog, col)
{
struct multipos *mpos = &subs.synt.list.multi[i];
/* Only accept single line matches. */
if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum)
/* Only accept single line matches that are valid. */
if (mpos->start.lnum >= 0
&& mpos->start.lnum == mpos->end.lnum
&& mpos->end.col >= mpos->start.col)
re_extmatch_out->matches[i] =
vim_strnsave(reg_getline(mpos->start.lnum)
+ mpos->start.col,
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
253,
/**/
252,
/**/

0 comments on commit 5a4e160

Please sign in to comment.