073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.623
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.623
073263
Problem:    Crash with pattern: \(\)\{80000}  (Dominique Pelle)
073263
Solution:   When the max limit is large fall back to the old engine.
073263
Files:	    src/regexp_nfa.c
073263
073263
073263
*** ../vim-7.4.622/src/regexp_nfa.c	2015-02-05 20:29:55.071222529 +0100
073263
--- src/regexp_nfa.c	2015-02-10 18:09:53.878896813 +0100
073263
***************
073263
*** 2034,2042 ****
073263
  	    }
073263
  
073263
  	    /* The engine is very inefficient (uses too many states) when the
073263
! 	     * maximum is much larger than the minimum.  Bail out if we can
073263
! 	     * use the other engine. */
073263
! 	    if ((nfa_re_flags & RE_AUTO) && maxval > minval + 200)
073263
  		return FAIL;
073263
  
073263
  	    /* Ignore previous call to nfa_regatom() */
073263
--- 2034,2043 ----
073263
  	    }
073263
  
073263
  	    /* The engine is very inefficient (uses too many states) when the
073263
! 	     * maximum is much larger than the minimum and when the maximum is
073263
! 	     * large.  Bail out if we can use the other engine. */
073263
! 	    if ((nfa_re_flags & RE_AUTO)
073263
! 				   && (maxval > minval + 200 || maxval > 500))
073263
  		return FAIL;
073263
  
073263
  	    /* Ignore previous call to nfa_regatom() */
073263
***************
073263
*** 4254,4260 ****
073263
   * Add "state" and possibly what follows to state list ".".
073263
   * Returns "subs_arg", possibly copied into temp_subs.
073263
   */
073263
- 
073263
      static regsubs_T *
073263
  addstate(l, state, subs_arg, pim, off)
073263
      nfa_list_T		*l;	    /* runtime state list */
073263
--- 4255,4260 ----
073263
***************
073263
*** 4392,4397 ****
073263
--- 4392,4398 ----
073263
  		    subs = &temp_subs;
073263
  		}
073263
  
073263
+ 		/* TODO: check for vim_realloc() returning NULL. */
073263
  		l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T));
073263
  		l->len = newlen;
073263
  	    }
073263
*** ../vim-7.4.622/src/version.c	2015-02-05 20:29:55.071222529 +0100
073263
--- src/version.c	2015-02-10 18:14:05.287650419 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     623,
073263
  /**/
073263
073263
-- 
073263
hundred-and-one symptoms of being an internet addict:
073263
210. When you get a divorce, you don't care about who gets the children,
073263
     but discuss endlessly who can use the email address.
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    ///