]> Savannah Git Hosting - gnulib.git/commitdiff
regex: omit debug assignment when not debugging
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Oct 2019 00:51:03 +0000 (17:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Oct 2019 01:34:05 +0000 (18:34 -0700)
* lib/regexec.c (re_search_internal) [!DEBUG]:
Remove unnecessary assignment to pacify Coverity.

ChangeLog
lib/regexec.c

index 360973ba46765c9d54f50700f444fd592f3bf2cf..e9e3376662793e1cda6fc5bcb9a4fae53ce22e80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2019-10-09  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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.
index 0d32e0139f6d4d452aa813070d8369d1a2db4bc2..809f89e26ccdfa360abb72c7ce22b6c035f378a5 100644 (file)
@@ -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.  */