From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C5523858C31; Wed, 20 Sep 2023 20:46:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C5523858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695242798; bh=UWmMIiTv65kPb7oU34P+Kg/onk7fPmoPMSuOhOzUI9g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z6PEUHjKfMYk5IqCmbpqnSUx1AGVVIC69WmotTooWMauSv9W5p7YUlNb5FwubVUp7 grZNsMO2jlIX3e6DSiIWBvRjGNpTN4C7K4/ywXO1qPr3ISCEJHhd9Kr3OHwFBGK1Jc L/mE1p8iOWZuEhWiOo9of69dHJh482i/vRVXfve0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/61474] ICE (segfault) in preprocessor Date: Wed, 20 Sep 2023 20:46:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61474 --- Comment #3 from CVS Commits --- The master branch has been updated by Lewis Hyatt : https://gcc.gnu.org/g:601dbf2a799f691688dfe78250b5bea2717b5b5e commit r14-4185-g601dbf2a799f691688dfe78250b5bea2717b5b5e Author: Lewis Hyatt Date: Fri Sep 15 13:31:51 2023 -0400 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 attem= pts 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.=