gcc/libcpp
Lewis Hyatt 601dbf2a79 libcpp: Fix ICE on #include after a line marker directive [PR61474]
As noted in the PR, GCC will segfault if a file name is first seen in a
linemarker directive, and then later seen in a normal #include.  This is
because the fake include process adds the file to the cache with a null PATH
member. The normal #include finds this file in the cache and then attempts
to use the null PATH.  Resolve by adding the file to the cache with a unique
starting directory, so that the fake entry will only be found by a
subsequent fake include, not by a real one.

libcpp/ChangeLog:

	PR preprocessor/61474
	* files.cc (_cpp_find_file): Set DONT_READ to TRUE for fake
	include files.
	(_cpp_fake_include): Pass a unique cpp_dir* address so
	the fake file will not be found when looked up for real.

gcc/testsuite/ChangeLog:

	PR preprocessor/61474
	* c-c++-common/cpp/pr61474-2.h: New test.
	* c-c++-common/cpp/pr61474.c: New test.
	* c-c++-common/cpp/pr61474.h: New test.
2023-09-20 16:44:24 -04:00
..
include p1689r5: initial support 2023-09-19 17:32:23 -04:00
po
aclocal.m4
ChangeLog Daily bump. 2023-09-20 00:17:55 +00:00
ChangeLog.jit
charset.cc
combining-chars.inc
config.in
configure egrep in binutils 2023-08-07 22:59:40 +02:00
configure.ac
directives.cc
errors.cc
expr.cc C _BitInt incremental fixes [PR102989] 2023-09-06 17:39:15 +02:00
files.cc libcpp: Fix ICE on #include after a line marker directive [PR61474] 2023-09-20 16:44:24 -04:00
generated_cpp_wcwidth.h
identifiers.cc
init.cc p1689r5: initial support 2023-09-19 17:32:23 -04:00
internal.h
lex.cc libcpp: Handle extended characters in user-defined literal suffix [PR103902] 2023-07-18 22:37:55 -04:00
line-map.cc
location-example.txt
macro.cc
Makefile.in
makeucnid.cc
makeuname2c.cc
mkdeps.cc p1689r5: initial support 2023-09-19 17:32:23 -04:00
pch.cc
printable-chars.inc
symtab.cc
system.h
traditional.cc
ucnid.h
ucnid.tab
uname2c.h