# HG changeset patch # User Bram Moolenaar # Date 1369079823 -7200 # Node ID a63361b9097952faa9c9eba2caebef09b9f8b62b # Parent 7058abc81075d4f614d3b0eac424904f0ce9c7f9 updated for version 7.3.979 Problem: Complex NFA regexp doesn't work. Solution: Set actual state stack end instead of using an arbitrary number. (Yasuhiro Matsumoto) diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 979, +/**/ 978, /**/ 977,