From 4e02b30c761c76d04057fa5f6bba71401f9310cd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Oct 2019 17:51:03 -0700 Subject: [PATCH] regex: omit debug assignment when not debugging * lib/regexec.c (re_search_internal) [!DEBUG]: Remove unnecessary assignment to pacify Coverity. --- ChangeLog | 4 ++++ lib/regexec.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 360973ba46..e9e3376662 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2019-10-09 Paul Eggert + regex: omit debug assignment when not debugging + * lib/regexec.c (re_search_internal) [!DEBUG]: + Remove unnecessary assignment. + regex: tell compiler there’s at most 256 arcs out Partly this is to help the reader (and maybe help GCC); partly this is to pacify Coverity. diff --git a/lib/regexec.c b/lib/regexec.c index 0d32e0139f..809f89e26c 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -817,7 +817,9 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, break; if (__glibc_unlikely (err != REG_NOMATCH)) goto free_return; +#ifdef DEBUG match_last = -1; +#endif } else break; /* We found a match. */ -- 2.39.5