Pacify GCC 16.1.1 -Wanalyzer-null-dereference
* src/regex-emacs.c (forall_firstchar): Avoid undefined behavior in the 2nd eassert when !bufp && !pend. This pacifies GCC 16.1.1 20260501 (Red Hat 16.1.1-1) x86-64 when Emacs is configured with --enable-gcc-warnings.
This commit is contained in:
parent
07fe0b297b
commit
71336e837a
1 changed files with 1 additions and 2 deletions
|
|
@ -3044,8 +3044,7 @@ static bool
|
|||
forall_firstchar (struct re_pattern_buffer *bufp, re_char *p, re_char *pend,
|
||||
bool f (re_char *p, void *arg), void *arg)
|
||||
{
|
||||
eassert (!bufp || bufp->used);
|
||||
eassert (pend || bufp->used);
|
||||
eassert (bufp ? !!bufp->used : !!pend);
|
||||
return forall_firstchar_1 (p, pend,
|
||||
bufp ? bufp->buffer - 1 : p,
|
||||
bufp ? bufp->buffer + bufp->used + 1 : pend,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue