@@ -290,10 +290,11 @@ static void nfa_dump __ARGS((nfa_regprog_T *prog));
290290#endif
291291static int * re2post __ARGS ((void ));
292292static nfa_state_T * alloc_state __ARGS ((int c , nfa_state_T * out , nfa_state_T * out1 ));
293+ static void st_error __ARGS ((int * postfix , int * end , int * p ));
294+ static int nfa_max_width __ARGS ((nfa_state_T * startstate , int depth ));
293295static nfa_state_T * post2nfa __ARGS ((int * postfix , int * end , int nfa_calc_size ));
294296static void nfa_postprocess __ARGS ((nfa_regprog_T * prog ));
295297static int check_char_class __ARGS ((int class , int c ));
296- static void st_error __ARGS ((int * postfix , int * end , int * p ));
297298static void nfa_save_listids __ARGS ((nfa_regprog_T * prog , int * list ));
298299static void nfa_restore_listids __ARGS ((nfa_regprog_T * prog , int * list ));
299300static int nfa_re_num_cmp __ARGS ((long_u val , int op , long_u pos ));
@@ -3469,6 +3470,7 @@ typedef struct
34693470#ifdef ENABLE_LOG
34703471static void log_subsexpr __ARGS ((regsubs_T * subs ));
34713472static void log_subexpr __ARGS ((regsub_T * sub ));
3473+ static char * pim_info __ARGS ((nfa_pim_T * pim ));
34723474
34733475 static void
34743476log_subsexpr (subs )
@@ -3508,7 +3510,8 @@ log_subexpr(sub)
35083510}
35093511
35103512 static char *
3511- pim_info (nfa_pim_T * pim )
3513+ pim_info (pim )
3514+ nfa_pim_T * pim ;
35123515{
35133516 static char buf [30 ];
35143517
@@ -3532,6 +3535,7 @@ static void clear_sub __ARGS((regsub_T *sub));
35323535static void copy_sub __ARGS ((regsub_T * to , regsub_T * from ));
35333536static void copy_sub_off __ARGS ((regsub_T * to , regsub_T * from ));
35343537static int sub_equal __ARGS ((regsub_T * sub1 , regsub_T * sub2 ));
3538+ static int match_backref __ARGS ((regsub_T * sub , int subidx , int * bytelen ));
35353539static int has_state_with_pos __ARGS ((nfa_list_T * l , nfa_state_T * state , regsubs_T * subs ));
35363540static int state_in_list __ARGS ((nfa_list_T * l , nfa_state_T * state , regsubs_T * subs ));
35373541static void addstate __ARGS ((nfa_list_T * l , nfa_state_T * state , regsubs_T * subs , nfa_pim_T * pim , int off ));
@@ -4319,8 +4323,6 @@ check_char_class(class, c)
43194323 return FAIL ;
43204324}
43214325
4322- static int match_backref __ARGS ((regsub_T * sub , int subidx , int * bytelen ));
4323-
43244326/*
43254327 * Check for a match with subexpression "subidx".
43264328 * Return TRUE if it matches.
@@ -5195,6 +5197,10 @@ nfa_regmatch(prog, start, submatch, m)
51955197 || t -> state -> c == NFA_START_INVISIBLE_BEFORE_FIRST
51965198 || t -> state -> c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST )
51975199 {
5200+ /* Copy submatch info for the recursive call, so that
5201+ * \1 can be matched. */
5202+ copy_sub_off (& m -> norm , & t -> subs .norm );
5203+
51985204 /*
51995205 * First try matching the invisible match, then what
52005206 * follows.
0 commit comments