public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3756] Fix NULL filename handling
@ 2022-11-07 16:36 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2022-11-07 16:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9aa1b63a5554563b7a3081391358d6cedcabea88

commit r13-3756-g9aa1b63a5554563b7a3081391358d6cedcabea88
Author: Richard Purdie <richard.purdie@linuxfoundation.org>
Date:   Mon Nov 7 17:26:44 2022 +0100

    Fix NULL filename handling
    
    The previous commit introduced a regression as some Ada tests end up passing
    NULL as the filename to remap_filename.  Handle this as before to fix them.
    
    gcc/
            * file-prefix-map.cc (remap_filename): Handle NULL filenames.

Diff:
---
 gcc/file-prefix-map.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/file-prefix-map.cc b/gcc/file-prefix-map.cc
index 439586bd2b5..40b10edcf92 100644
--- a/gcc/file-prefix-map.cc
+++ b/gcc/file-prefix-map.cc
@@ -73,7 +73,7 @@ remap_filename (file_prefix_map *maps, const char *filename)
   char *realname;
   size_t name_len;
 
-  if (lbasename (filename) == filename)
+  if (!filename || lbasename (filename) == filename)
     return filename;
 
   realname = lrealpath (filename);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-07 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 16:36 [gcc r13-3756] Fix NULL filename handling Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).