Skip to content

Commit

Permalink
Fix an off-by-one error in the tag stack traversing
Browse files Browse the repository at this point in the history
Since the whole `stack' array isn't completely cleared by the
`initStack' routine ctags would sometimes segfault after reading stale
or invalid data off the topmost item.
  • Loading branch information
LemonBoy committed Mar 6, 2018
1 parent e5c86f7 commit 92d8be1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parsers/ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ static contextType popStrongContext ( void )
static void jumpToMatchContext ( void )
{
int i;
for (i = stackIndex; i >= 0; --i)
for (i = stackIndex - 1; i >= 0; --i)
{
if (stack[i].type == ContextMatch)
{
Expand Down

0 comments on commit 92d8be1

Please sign in to comment.