Karsten Hopp 6936df
To: vim_dev@googlegroups.com
Karsten Hopp 6936df
Subject: Patch 7.3.1121
Karsten Hopp 6936df
Fcc: outbox
Karsten Hopp 6936df
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6936df
Mime-Version: 1.0
Karsten Hopp 6936df
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6936df
Content-Transfer-Encoding: 8bit
Karsten Hopp 6936df
------------
Karsten Hopp 6936df
Karsten Hopp 6936df
Patch 7.3.1121
Karsten Hopp 6936df
Problem:    New regexp engine: adding states that are not used.
Karsten Hopp 6936df
Solution:   Don't add the states.
Karsten Hopp 6936df
Files:	    src/regexp_nfa.c
Karsten Hopp 6936df
Karsten Hopp 6936df
Karsten Hopp 6936df
*** ../vim-7.3.1120/src/regexp_nfa.c	2013-06-05 16:33:05.000000000 +0200
Karsten Hopp 6936df
--- src/regexp_nfa.c	2013-06-05 16:47:27.000000000 +0200
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 3169,3174 ****
Karsten Hopp 6936df
--- 3176,3182 ----
Karsten Hopp 6936df
  	case NFA_SPLIT:
Karsten Hopp 6936df
  	case NFA_NOT:
Karsten Hopp 6936df
  	case NFA_NOPEN:
Karsten Hopp 6936df
+ 	case NFA_SKIP_CHAR:
Karsten Hopp 6936df
  	case NFA_NCLOSE:
Karsten Hopp 6936df
  	case NFA_MCLOSE:
Karsten Hopp 6936df
  	case NFA_MCLOSE1:
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 3192,3197 ****
Karsten Hopp 6936df
--- 3200,3206 ----
Karsten Hopp 6936df
  	case NFA_ZCLOSE8:
Karsten Hopp 6936df
  	case NFA_ZCLOSE9:
Karsten Hopp 6936df
  #endif
Karsten Hopp 6936df
+ 	case NFA_ZEND:
Karsten Hopp 6936df
  	    /* These nodes are not added themselves but their "out" and/or
Karsten Hopp 6936df
  	     * "out1" may be added below.  */
Karsten Hopp 6936df
  	    break;
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 3218,3223 ****
Karsten Hopp 6936df
--- 3227,3233 ----
Karsten Hopp 6936df
  	case NFA_ZOPEN8:
Karsten Hopp 6936df
  	case NFA_ZOPEN9:
Karsten Hopp 6936df
  #endif
Karsten Hopp 6936df
+ 	case NFA_ZSTART:
Karsten Hopp 6936df
  	    /* These nodes do not need to be added, but we need to bail out
Karsten Hopp 6936df
  	     * when it was tried to be added to this list before. */
Karsten Hopp 6936df
  	    if (state->lastlist[nfa_ll_index] == l->id)
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 4362,4371 ****
Karsten Hopp 6936df
  
Karsten Hopp 6936df
  	    case NFA_START_INVISIBLE:
Karsten Hopp 6936df
  	    case NFA_START_INVISIBLE_BEFORE:
Karsten Hopp 6936df
- 		/* If invisible match has a higher chance to fail, do it
Karsten Hopp 6936df
- 		 * right away.  Otherwise postpone it until what follows is
Karsten Hopp 6936df
- 		 * matching and causes addstate(nextlist, ..) to be called.
Karsten Hopp 6936df
- 		 * This is indicated by the "pim" field. */
Karsten Hopp 6936df
  		{
Karsten Hopp 6936df
  		    nfa_pim_T *pim;
Karsten Hopp 6936df
  		    int cout = t->state->out1->out->c;
Karsten Hopp 6936df
--- 4372,4377 ----
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 4863,4874 ****
Karsten Hopp 6936df
  			log_subsexpr(&nextlist->t[nextlist->n - 1].subs);
Karsten Hopp 6936df
  #endif
Karsten Hopp 6936df
  		    }
Karsten Hopp 6936df
- 
Karsten Hopp 6936df
  		}
Karsten Hopp 6936df
  		break;
Karsten Hopp 6936df
  	      }
Karsten Hopp 6936df
  	    case NFA_SKIP:
Karsten Hopp 6936df
! 	      /* charater of previous matching \1 .. \9 */
Karsten Hopp 6936df
  	      if (t->count - clen <= 0)
Karsten Hopp 6936df
  	      {
Karsten Hopp 6936df
  		  /* end of match, go to what follows */
Karsten Hopp 6936df
--- 4869,4879 ----
Karsten Hopp 6936df
  			log_subsexpr(&nextlist->t[nextlist->n - 1].subs);
Karsten Hopp 6936df
  #endif
Karsten Hopp 6936df
  		    }
Karsten Hopp 6936df
  		}
Karsten Hopp 6936df
  		break;
Karsten Hopp 6936df
  	      }
Karsten Hopp 6936df
  	    case NFA_SKIP:
Karsten Hopp 6936df
! 	      /* character of previous matching \1 .. \9  or \@> */
Karsten Hopp 6936df
  	      if (t->count - clen <= 0)
Karsten Hopp 6936df
  	      {
Karsten Hopp 6936df
  		  /* end of match, go to what follows */
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 4892,4903 ****
Karsten Hopp 6936df
  	      }
Karsten Hopp 6936df
  	      break;
Karsten Hopp 6936df
  
Karsten Hopp 6936df
- 	    case NFA_SKIP_CHAR:
Karsten Hopp 6936df
- 	    case NFA_ZSTART:
Karsten Hopp 6936df
- 	    case NFA_ZEND:
Karsten Hopp 6936df
- 		/* TODO: should not happen? */
Karsten Hopp 6936df
- 		break;
Karsten Hopp 6936df
- 
Karsten Hopp 6936df
  	    case NFA_LNUM:
Karsten Hopp 6936df
  	    case NFA_LNUM_GT:
Karsten Hopp 6936df
  	    case NFA_LNUM_LT:
Karsten Hopp 6936df
--- 4897,4902 ----
Karsten Hopp 6936df
*** ../vim-7.3.1120/src/version.c	2013-06-05 16:33:05.000000000 +0200
Karsten Hopp 6936df
--- src/version.c	2013-06-05 16:50:39.000000000 +0200
Karsten Hopp 6936df
***************
Karsten Hopp 6936df
*** 730,731 ****
Karsten Hopp 6936df
--- 730,733 ----
Karsten Hopp 6936df
  {   /* Add new patch number below this line */
Karsten Hopp 6936df
+ /**/
Karsten Hopp 6936df
+     1121,
Karsten Hopp 6936df
  /**/
Karsten Hopp 6936df
Karsten Hopp 6936df
-- 
Karsten Hopp 6936df
Where do you want to crash today?
Karsten Hopp 6936df
Karsten Hopp 6936df
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6936df
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6936df
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6936df
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///