diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-07 17:26:44 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2022-11-07 17:36:06 +0100 |
commit | 9aa1b63a5554563b7a3081391358d6cedcabea88 (patch) | |
tree | 7eaaea6def3ff7c02d326180cc5382a2932630b9 /gcc/file-prefix-map.cc | |
parent | cb0ceeaee9e041aaac3edd089b07b439621d0f29 (diff) | |
download | gcc-9aa1b63a5554563b7a3081391358d6cedcabea88.zip gcc-9aa1b63a5554563b7a3081391358d6cedcabea88.tar.gz gcc-9aa1b63a5554563b7a3081391358d6cedcabea88.tar.bz2 |
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.
Diffstat (limited to 'gcc/file-prefix-map.cc')
-rw-r--r-- | gcc/file-prefix-map.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/file-prefix-map.cc b/gcc/file-prefix-map.cc index 439586b..40b10ed 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); |