Mercurial > vim
comparison src/regexp_nfa.c @ 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 | 90b16a0022e5 |
children | dca9e6b931d3 |
comparison
equal
deleted
inserted
replaced
23250:b5446fb9c4ef | 23251:8caba5736a9a |
---|---|
7234 | 7234 |
7235 if (end->lnum < start->lnum | 7235 if (end->lnum < start->lnum |
7236 || (end->lnum == start->lnum && end->col < start->col)) | 7236 || (end->lnum == start->lnum && end->col < start->col)) |
7237 rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0]; | 7237 rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0]; |
7238 } | 7238 } |
7239 else | 7239 else if (retval > 0) |
7240 { | 7240 { |
7241 if (rex.reg_match->endp[0] < rex.reg_match->startp[0]) | 7241 if (rex.reg_match->endp[0] < rex.reg_match->startp[0]) |
7242 rex.reg_match->endp[0] = rex.reg_match->startp[0]; | 7242 rex.reg_match->endp[0] = rex.reg_match->startp[0]; |
7243 } | 7243 } |
7244 | 7244 |