updated for version 7.3.1258

Problem:    Using submatch() may crash Vim. (Ingo Karkat)
Solution:   Restore the number of subexpressions used.
This commit is contained in:
Bram Moolenaar
2013-06-28 23:04:42 +02:00
parent e3a0b53c2e
commit 4d9ae21a34
2 changed files with 5 additions and 0 deletions

View File

@ -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
{

View File

@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1258,
/**/
1257,
/**/