summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-14 21:15:25 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-14 21:15:25 +0200
commitc5089bb8ff4d9f15c11632d7486b9068e09ff202 (patch)
treeec562d3f0c62d71f9c31b86917428d8ffa8e42c6
parent580abea48a0de604b40aca734b22f3ea7c0e7531 (diff)
downloadvim-git-c5089bb8ff4d9f15c11632d7486b9068e09ff202.tar.gz
updated for version 7.3.1192v7.3.1192
Problem: Valgrind reports errors when using backreferences. (Dominique Pelle) Solution: Do not check the end of submatches.
-rw-r--r--src/regexp_nfa.c45
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 36 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 702095548..7a335336d 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -3612,7 +3612,7 @@ copy_sub_off(to, from)
}
/*
- * Return TRUE if "sub1" and "sub2" have the same positions.
+ * Return TRUE if "sub1" and "sub2" have the same start positions.
*/
static int
sub_equal(sub1, sub2)
@@ -3621,10 +3621,10 @@ sub_equal(sub1, sub2)
{
int i;
int todo;
- linenr_T s1, e1;
- linenr_T s2, e2;
- char_u *sp1, *ep1;
- char_u *sp2, *ep2;
+ linenr_T s1;
+ linenr_T s2;
+ char_u *sp1;
+ char_u *sp2;
todo = sub1->in_use > sub2->in_use ? sub1->in_use : sub2->in_use;
if (REG_MULTI)
@@ -3632,33 +3632,18 @@ sub_equal(sub1, sub2)
for (i = 0; i < todo; ++i)
{
if (i < sub1->in_use)
- {
s1 = sub1->list.multi[i].start.lnum;
- e1 = sub1->list.multi[i].end.lnum;
- }
else
- {
s1 = 0;
- e1 = 0;
- }
if (i < sub2->in_use)
- {
s2 = sub2->list.multi[i].start.lnum;
- e2 = sub2->list.multi[i].end.lnum;
- }
else
- {
s2 = 0;
- e2 = 0;
- }
- if (s1 != s2 || e1 != e2)
+ if (s1 != s2)
return FALSE;
if (s1 != 0 && sub1->list.multi[i].start.col
!= sub2->list.multi[i].start.col)
return FALSE;
- if (e1 != 0 && sub1->list.multi[i].end.col
- != sub2->list.multi[i].end.col)
- return FALSE;
}
}
else
@@ -3666,26 +3651,14 @@ sub_equal(sub1, sub2)
for (i = 0; i < todo; ++i)
{
if (i < sub1->in_use)
- {
sp1 = sub1->list.line[i].start;
- ep1 = sub1->list.line[i].end;
- }
else
- {
sp1 = NULL;
- ep1 = NULL;
- }
if (i < sub2->in_use)
- {
sp2 = sub2->list.line[i].start;
- ep2 = sub2->list.line[i].end;
- }
else
- {
sp2 = NULL;
- ep2 = NULL;
- }
- if (sp1 != sp2 || ep1 != ep2)
+ if (sp1 != sp2)
return FALSE;
}
}
@@ -3735,8 +3708,8 @@ has_state_with_pos(l, state, subs)
if (thread->state->id == state->id
&& sub_equal(&thread->subs.norm, &subs->norm)
#ifdef FEAT_SYN_HL
- && (!nfa_has_zsubexpr ||
- sub_equal(&thread->subs.synt, &subs->synt))
+ && (!nfa_has_zsubexpr
+ || sub_equal(&thread->subs.synt, &subs->synt))
#endif
)
return TRUE;
diff --git a/src/version.c b/src/version.c
index 8168890d2..28f680dfd 100644
--- 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 */
/**/
+ 1192,
+/**/
1191,
/**/
1190,