public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/80755] __has_include_next: internal compiler error: NULL directory in find_file Date: Thu, 14 Mar 2024 11:33:46 +0000 [thread overview] Message-ID: <bug-80755-4-E8YLJsQCY8@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-80755-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80755 --- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>: https://gcc.gnu.org/g:6c166e55b15894ceb07dcc7b55f900e50e24ec5b commit r14-9464-g6c166e55b15894ceb07dcc7b55f900e50e24ec5b Author: Lewis Hyatt <lhyatt@gmail.com> Date: Wed Dec 20 16:27:42 2023 -0500 libcpp: Fix __has_include_next ICE in the last directory of the path [PR80755] In libcpp/files.cc, the function _cpp_has_header(), which implements __has_include and __has_include_next, does not check for a NULL return value from search_path_head(), leading to an ICE tripping an assert when _cpp_find_file() tries to use it. Fix it by checking for that case and silently returning false instead. As suggested by the PR author, it is easiest to make a testcase by using the -idirafter option. To enable that, also modify the dg-additional-options testsuite procedure to make the global $srcdir available, since -idirafter requires the full path. libcpp/ChangeLog: PR preprocessor/80755 * files.cc (search_path_head): Add SUPPRESS_DIAGNOSTIC argument defaulting to false. (_cpp_has_header): Silently return false if the search path has been exhausted, rather than issuing a diagnostic and then hitting an assert. gcc/testsuite/ChangeLog: * lib/gcc-defs.exp (dg-additional-options): Make $srcdir usable in a dg-additional-options directive. * c-c++-common/cpp/has-include-next-2-dir/has-include-next-2.h: New test. * c-c++-common/cpp/has-include-next-2.c: New test.
next prev parent reply other threads:[~2024-03-14 11:33 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-80755-4@http.gcc.gnu.org/bugzilla/> 2022-10-31 9:46 ` helmut at subdivi dot de 2023-12-18 4:58 ` sjames at gcc dot gnu.org 2023-12-21 12:39 ` lhyatt at gcc dot gnu.org 2024-02-27 23:42 ` sjames at gcc dot gnu.org 2024-02-28 0:10 ` lhyatt at gcc dot gnu.org 2024-03-14 11:33 ` cvs-commit at gcc dot gnu.org [this message] 2024-03-14 11:35 ` lhyatt at gcc dot gnu.org
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=bug-80755-4-E8YLJsQCY8@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).