From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix PR65550, ICE on invalid PCH use
Date: Thu, 09 Apr 2015 13:03:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.11.1504091502270.6786@zhemvz.fhfr.qr> (raw)
The following makes the checks whether the context allows a PCH file
(only the first include may be one, and not nested) more robust
thereby fixing PR65550.
Bootstrapped and tested on x86_64-unknown-linux-gnu - ok?
Thanks,
Richard.
2015-04-09 Richard Biener <rguenther@suse.de>
PR pch/65550
* files.c (pch_open_file): Allow main and pre-included files
when trying to open a PCH.
Index: libcpp/files.c
===================================================================
--- libcpp/files.c (revision 221942)
+++ libcpp/files.c (working copy)
@@ -291,11 +291,13 @@ pch_open_file (cpp_reader *pfile, _cpp_f
/* If the file is not included as first include from either the toplevel
file or the command-line it is not a valid use of PCH. */
- if (pfile->all_files
- && pfile->all_files->next_file
- && !(pfile->all_files->implicit_preinclude
- || pfile->all_files->next_file->implicit_preinclude))
- return false;
+ for (_cpp_file *f = pfile->all_files; f; f = f->next_file)
+ if (f->implicit_preinclude)
+ continue;
+ else if (f->main_file)
+ break;
+ else
+ return false;
flen = strlen (path);
len = flen + sizeof (extension);
next reply other threads:[~2015-04-09 13:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 13:03 Richard Biener [this message]
2015-04-09 13:19 ` Jakub Jelinek
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=alpine.LSU.2.11.1504091502270.6786@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@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: link
Be 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).