To: vim_dev@googlegroups.com Subject: Patch 8.2.2171 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2171 Problem: Valgrind warning for using uninitialized value. Solution: Do not use "startp" or "endp" unless there is a match. Files: src/regexp_nfa.c *** ../vim-8.2.2170/src/regexp_nfa.c 2020-12-09 16:36:00.404656177 +0100 --- src/regexp_nfa.c 2020-12-20 17:39:40.939320694 +0100 *************** *** 7236,7242 **** || (end->lnum == start->lnum && end->col < start->col)) rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0]; } ! else { if (rex.reg_match->endp[0] < rex.reg_match->startp[0]) rex.reg_match->endp[0] = rex.reg_match->startp[0]; --- 7236,7242 ---- || (end->lnum == start->lnum && end->col < start->col)) rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0]; } ! 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]; *** ../vim-8.2.2170/src/version.c 2020-12-20 17:47:49.257182258 +0100 --- src/version.c 2020-12-20 17:59:32.634380583 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2171, /**/ -- You can test a person's importance in the organization by asking how much RAM his computer has. Anybody who knows the answer to that question is not a decision-maker. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///