073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.253
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.253
073263
Problem:    Crash when using cpp syntax file with pattern using external
073263
	    match. (Havard Garnes)
073263
Solution:   Discard match when end column is before start column.
073263
Files:	    src/regexp.c, src/regexp_nfa.c
073263
073263
073263
*** ../vim-7.4.252/src/regexp.c	2014-04-02 19:00:53.043644100 +0200
073263
--- src/regexp.c	2014-04-06 21:26:17.087362776 +0200
073263
***************
073263
*** 4146,4152 ****
073263
  	    {
073263
  		/* Only accept single line matches. */
073263
  		if (reg_startzpos[i].lnum >= 0
073263
! 			&& reg_endzpos[i].lnum == reg_startzpos[i].lnum)
073263
  		    re_extmatch_out->matches[i] =
073263
  			vim_strnsave(reg_getline(reg_startzpos[i].lnum)
073263
  						       + reg_startzpos[i].col,
073263
--- 4146,4153 ----
073263
  	    {
073263
  		/* Only accept single line matches. */
073263
  		if (reg_startzpos[i].lnum >= 0
073263
! 			&& reg_endzpos[i].lnum == reg_startzpos[i].lnum
073263
! 			&& reg_endzpos[i].col >= reg_startzpos[i].col)
073263
  		    re_extmatch_out->matches[i] =
073263
  			vim_strnsave(reg_getline(reg_startzpos[i].lnum)
073263
  						       + reg_startzpos[i].col,
073263
*** ../vim-7.4.252/src/regexp_nfa.c	2014-03-23 15:12:29.935264336 +0100
073263
--- src/regexp_nfa.c	2014-04-06 21:16:57.111361553 +0200
073263
***************
073263
*** 6781,6788 ****
073263
  	    {
073263
  		struct multipos *mpos = &subs.synt.list.multi[i];
073263
  
073263
! 		/* Only accept single line matches. */
073263
! 		if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum)
073263
  		    re_extmatch_out->matches[i] =
073263
  			vim_strnsave(reg_getline(mpos->start.lnum)
073263
  							    + mpos->start.col,
073263
--- 6781,6790 ----
073263
  	    {
073263
  		struct multipos *mpos = &subs.synt.list.multi[i];
073263
  
073263
! 		/* Only accept single line matches that are valid. */
073263
! 		if (mpos->start.lnum >= 0
073263
! 			&& mpos->start.lnum == mpos->end.lnum
073263
! 			&& mpos->end.col >= mpos->start.col)
073263
  		    re_extmatch_out->matches[i] =
073263
  			vim_strnsave(reg_getline(mpos->start.lnum)
073263
  							    + mpos->start.col,
073263
*** ../vim-7.4.252/src/version.c	2014-04-06 21:08:41.315360470 +0200
073263
--- src/version.c	2014-04-06 21:33:17.271363694 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     253,
073263
  /**/
073263
073263
-- 
073263
A day without sunshine is like, well, night.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///