From: Paul Eggert Date: Sun, 20 Apr 2025 02:21:15 +0000 (-0700) Subject: Pacify GCC 15 -Wanalyzer-null-dereference X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ea5872034bdf2351d459b0508e4dd2d899f96728;p=emacs.git Pacify GCC 15 -Wanalyzer-null-dereference * src/emacs.c (find_emacs_executable): Add an eassume. This pacifies -Wanalyzer-null-dereference with gcc (GCC) 15.0.1 20250329 (Red Hat 15.0.1-0). (cherry picked from commit 67ae1790088616777b352acffc63aeeb7ee50cb6) --- diff --git a/src/emacs.c b/src/emacs.c index 79604d09a37..cf8f4bd63f7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -808,6 +808,8 @@ find_emacs_executable (char const *argv0, ptrdiff_t *candidate_size) candidate = xpalloc (NULL, candidate_size, needed - *candidate_size + 1, -1, 1); } + else + eassume (candidate); memcpy (candidate + 0, path_part, path_part_length); candidate[path_part_length] = DIRECTORY_SEP; memcpy (candidate + path_part_length + 1, argv0, argv0_length + 1);