From 60d9b4134f8661dc25134dbe54be15f6138718c8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 15 Apr 2025 13:50:32 -0700 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ lib/dfa.c | 1 + 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7d255be3a2..28322a2655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-04-15 Paul Eggert + + 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 gnulib-tool.py: Fix exception during --update with changed macro-prefix. diff --git a/lib/dfa.c b/lib/dfa.c index 684043dd8f..cbacdc04cf 100644 --- 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"); -- 2.39.5