[Bug 534880]
Cvs-commit
534880 at bugs.launchpad.net
Wed Sep 20 20:46:36 UTC 2023
The master branch has been updated by Lewis Hyatt <lhyatt at gcc.gnu.org>:
https://gcc.gnu.org/g:601dbf2a799f691688dfe78250b5bea2717b5b5e
commit r14-4185-g601dbf2a799f691688dfe78250b5bea2717b5b5e
Author: Lewis Hyatt <lhyatt at gmail.com>
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 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.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/534880
Title:
ICE (segfault) in preprocessor
Status in gcc:
Fix Released
Status in gcc-defaults package in Ubuntu:
Triaged
Bug description:
gcc dies with segmentation violation on Intrepid and Karmic (didn't
try others) with the following shell code; this is not an academic
example but the maximally reduced version of my code:
echo -e '#include "b.h"\n#include "c.h"' >a.c; echo '# 1 "c.h" 1'
>b.h; gcc -E a.c
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 8.10
Package: gcc 4:4.3.1-1ubuntu2
ProcEnviron:
PATH=.:/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: gcc-defaults
Uname: Linux 2.6.27-16-generic i686
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/534880/+subscriptions
More information about the foundations-bugs
mailing list