bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] regex: omit debug assignment when not debugging


From: Paul Eggert
Subject: [PATCH 4/4] regex: omit debug assignment when not debugging
Date: Wed, 9 Oct 2019 18:34:27 -0700

* 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 360973ba4..e9e337666 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2019-10-09  Paul Eggert  <address@hidden>
 
+       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 0d32e0139..809f89e26 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.21.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]