From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] gcc/file-prefix-map: Fix NULL filename handling
Date: Fri, 4 Nov 2022 17:25:37 +0000 [thread overview]
Message-ID: <20221104172537.1039148-1-richard.purdie@linuxfoundation.org> (raw)
e5c15eb183f17e806ad6b58c9497321ded87866f introduced a regression as
some ada tests end up passing NULL as the filename to remap_filename().
Handle this as before to fix the tests.
gcc/ChangeLog:
* file-prefix-map.cc (remap_filename): Handle NULL filenames.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
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);
--
2.34.1
next reply other threads:[~2022-11-04 17:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 17:25 Richard Purdie [this message]
2022-11-05 11:06 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221104172537.1039148-1-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).