Skip to content

Commit d14db7f

Browse files
committed
updated for version 7.4.003
Problem: Memory access error in Ruby syntax highlighting. (Christopher Chow) Solution: Refresh stale pointer. (James McCoy)
1 parent c49e96b commit d14db7f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/regexp_nfa.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4120,7 +4120,7 @@ addstate(l, state, subs_arg, pim, off)
41204120
sub = &subs->norm;
41214121
}
41224122
#ifdef FEAT_SYN_HL
4123-
else if (state->c >= NFA_ZOPEN)
4123+
else if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
41244124
{
41254125
subidx = state->c - NFA_ZOPEN;
41264126
sub = &subs->synt;
@@ -4189,6 +4189,13 @@ addstate(l, state, subs_arg, pim, off)
41894189
}
41904190

41914191
subs = addstate(l, state->out, subs, pim, off);
4192+
/* "subs" may have changed, need to set "sub" again */
4193+
#ifdef FEAT_SYN_HL
4194+
if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
4195+
sub = &subs->synt;
4196+
else
4197+
#endif
4198+
sub = &subs->norm;
41924199

41934200
if (save_in_use == -1)
41944201
{
@@ -4237,7 +4244,7 @@ addstate(l, state, subs_arg, pim, off)
42374244
sub = &subs->norm;
42384245
}
42394246
#ifdef FEAT_SYN_HL
4240-
else if (state->c >= NFA_ZCLOSE)
4247+
else if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
42414248
{
42424249
subidx = state->c - NFA_ZCLOSE;
42434250
sub = &subs->synt;
@@ -4281,6 +4288,13 @@ addstate(l, state, subs_arg, pim, off)
42814288
}
42824289

42834290
subs = addstate(l, state->out, subs, pim, off);
4291+
/* "subs" may have changed, need to set "sub" again */
4292+
#ifdef FEAT_SYN_HL
4293+
if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
4294+
sub = &subs->synt;
4295+
else
4296+
#endif
4297+
sub = &subs->norm;
42844298

42854299
if (REG_MULTI)
42864300
sub->list.multi[subidx].end = save_lpos;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ static char *(features[]) =
727727

728728
static int included_patches[] =
729729
{ /* Add new patch number below this line */
730+
/**/
731+
3,
730732
/**/
731733
2,
732734
/**/

0 commit comments

Comments
 (0)