From afe7c43025c0b2ebecb13e8fa1cbd1e1c23ba6a2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 20 Dec 2020 18:12:38 -0500 Subject: vim-patch:8.2.2171: valgrind warning for using uninitialized value Problem: Valgrind warning for using uninitialized value. Solution: Do not use "startp" or "endp" unless there is a match. https://github.com/vim/vim/commit/61e07b2394e12f757160cac421ec5c45dc4c074d --- src/nvim/regexp_nfa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 137b2304c0..22cd6baf6e 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -6601,7 +6601,7 @@ theend: || (end->lnum == start->lnum && end->col < start->col)) { rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0]; } - } else { + } else if (retval > 0) { if (rex.reg_match->endp[0] < rex.reg_match->startp[0]) { rex.reg_match->endp[0] = rex.reg_match->startp[0]; } -- cgit