]> Savannah Git Hosting - gnulib.git/commitdiff
dfa: pacify gcc -Wstringop-overflow
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Apr 2025 20:50:32 +0000 (13:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Apr 2025 20:50:32 +0000 (13:50 -0700)
Problem reported by Christian Hesse in:
https://bugs.gnu.org/77828
* lib/dfa.c (dfaanalyze): Pacify gcc -flto -Wstringop-overflow.

ChangeLog
lib/dfa.c

index 7d255be3a2d00e51bced063f6aded595d75f6ed7..28322a2655b40b919942aec111f58e249c9d2d5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-04-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       dfa: pacify gcc -Wstringop-overflow
+       Problem reported by Christian Hesse in:
+       https://bugs.gnu.org/77828
+       * lib/dfa.c (dfaanalyze): Pacify gcc -flto -Wstringop-overflow.
+
 2025-04-15  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Fix exception during --update with changed macro-prefix.
index 684043dd8fe09c4c623122263d1728a7f6c70602..cbacdc04cfcd702d400a62ff4d094962743e84ae 100644 (file)
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -2699,6 +2699,7 @@ dfaanalyze (struct dfa *d, bool searchflag)
 
   addtok (d, CAT);
   idx_t tindex = d->tindex;
+  assume (0 < tindex);
 
 #ifdef DEBUG
   fprintf (stderr, "dfaanalyze:\n");