changeset 23251:8caba5736a9a

patch 8.2.2171: valgrind warning for using uninitialized value Commit: https://github.com/vim/vim/commit/61e07b2394e12f757160cac421ec5c45dc4c074d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 20 17:59:53 2020 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Dec 2020 18:00:07 +0100
parents b5446fb9c4ef
children 35583da6397e
files src/regexp_nfa.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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];
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2171,
+/**/
     2170,
 /**/
     2169,