Patch 7.3.979
Problem:    Complex NFA regexp doesn't work.
Solution:   Set actual state stack end instead of using an arbitrary number.
            (Yasuhiro Matsumoto)
Files:      src/regexp_nfa.c


*** ../vim-7.3.978/src/regexp_nfa.c     2013-05-20 21:49:08.000000000 +0200
--- src/regexp_nfa.c    2013-05-20 21:53:24.000000000 +0200
***************
*** 17,24 ****
  #define           NFA_BRACES_MAXLIMIT             10
  /* For allocating space for the postfix representation */
  #define           NFA_POSTFIX_MULTIPLIER          (NFA_BRACES_MAXLIMIT + 2)*2
- /* Size of stack, used when converting the postfix regexp into NFA */
- #define           NFA_STACK_SIZE                  1024
  
  enum
  {
--- 17,22 ----
***************
*** 2160,2168 ****
      if (nfa_calc_size == FALSE)
      {
        /* Allocate space for the stack. Max states on the stack : nstate */
!       stack = (Frag_T *) lalloc((nstate + 1)*sizeof(Frag_T), TRUE);
        stackp = stack;
!       stack_end = stack + NFA_STACK_SIZE;
      }
  
      for (p = postfix; p < end; ++p)
--- 2158,2166 ----
      if (nfa_calc_size == FALSE)
      {
        /* Allocate space for the stack. Max states on the stack : nstate */
!       stack = (Frag_T *) lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
        stackp = stack;
!       stack_end = stack + (nstate + 1);
      }
  
      for (p = postfix; p < end; ++p)
*** ../vim-7.3.978/src/version.c        2013-05-20 21:49:08.000000000 +0200
--- src/version.c       2013-05-20 21:55:37.000000000 +0200
***************
*** 730,731 ****
--- 730,733 ----
  {   /* Add new patch number below this line */
+ /**/
+     979,
  /**/

-- 
   Another bucket of what can only be described as human ordure hits ARTHUR.
ARTHUR: ... Right!  (to the KNIGHTS) That settles it!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui