summaryrefslogtreecommitdiffstats
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-20 17:59:53 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-20 17:59:53 +0100
commit61e07b2394e12f757160cac421ec5c45dc4c074d (patch)
tree94a7ca36327ff69316500ae0cdb87195a5d49187 /src/regexp_nfa.c
parentf112f30a82f17114d8b08a0fb90928cd19440581 (diff)
patch 8.2.2171: valgrind warning for using uninitialized valuev8.2.2171
Problem: Valgrind warning for using uninitialized value. Solution: Do not use "startp" or "endp" unless there is a match.
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index da80ee9216..cbfed49b59 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -7236,7 +7236,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];