diff src/regexp_nfa.c @ 5029:c9e2ccc53f2e v7.3.1258

updated for version 7.3.1258 Problem: Using submatch() may crash Vim. (Ingo Karkat) Solution: Restore the number of subexpressions used.
author Bram Moolenaar <bram@vim.org>
date Fri, 28 Jun 2013 23:04:42 +0200
parents f451d60ab8ec
children a00cd1839ac4
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5198,6 +5198,8 @@ nfa_regmatch(prog, start, submatch, m)
 			 || t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST
 			 || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)
 		    {
+			int in_use = m->norm.in_use;
+
 			/* Copy submatch info for the recursive call, so that
 			 * \1 can be matched. */
 			copy_sub_off(&m->norm, &t->subs.norm);
@@ -5231,6 +5233,7 @@ nfa_regmatch(prog, start, submatch, m)
 			    add_here = TRUE;
 			    add_state = t->state->out1->out;
 			}
+			m->norm.in_use = in_use;
 		    }
 		    else
 		    {