From 92d8be1b24ebba6bf9852cbf631d1fe36a8708f5 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 6 Mar 2018 12:44:32 +0100 Subject: [PATCH] Fix an off-by-one error in the tag stack traversing 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. --- parsers/ocaml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsers/ocaml.c b/parsers/ocaml.c index 050c1a95ac..dfeb5a28dc 100644 --- a/parsers/ocaml.c +++ b/parsers/ocaml.c @@ -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) {