From: Paul Eggert Date: Thu, 10 Oct 2019 00:51:03 +0000 (-0700) Subject: regex: omit debug assignment when not debugging X-Git-Tag: v1.0~4633 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4e02b30c761c76d04057fa5f6bba71401f9310cd;p=gnulib.git regex: omit debug assignment when not debugging * lib/regexec.c (re_search_internal) [!DEBUG]: Remove unnecessary assignment to pacify Coverity. --- 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. */