]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.979 v7.3.979
authorBram Moolenaar <Bram@vim.org>
Mon, 20 May 2013 19:57:03 +0000 (21:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 20 May 2013 19:57:03 +0000 (21:57 +0200)
Problem:    Complex NFA regexp doesn't work.
Solution:   Set actual state stack end instead of using an arbitrary number.
            (Yasuhiro Matsumoto)

src/regexp_nfa.c
src/version.c

index 142e1abe6c6eb0e7252e7fa41a2fa43045f449f1..ef0148cf080198fcd2e14d9039d1c9f01e156c12 100644 (file)
@@ -17,8 +17,6 @@
 #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
 {
@@ -2160,9 +2158,9 @@ post2nfa(postfix, end, nfa_calc_size)
     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);
+       stack = (Frag_T *) lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
        stackp = stack;
-       stack_end = stack + NFA_STACK_SIZE;
+       stack_end = stack + (nstate + 1);
     }
 
     for (p = postfix; p < end; ++p)
index 3b4353d93fff2bd26e94cd4a9138da446869ecf0..6dc7e7ee54188d9a79700e7824624b941828ad21 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    979,
 /**/
     978,
 /**/