]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify GCC 15 -Wanalyzer-null-dereference
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Apr 2025 02:21:15 +0000 (19:21 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 21 Apr 2025 20:41:22 +0000 (22:41 +0200)
* 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)

src/emacs.c

index 79604d09a37f2236f9350cda9ead450840214271..cf8f4bd63f72587384a5577f62b574138f50a374 100644 (file)
@@ -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);