re PR preprocessor/38987 (Including a precompiled header from another header causes invalid assembly to be generated)

2009-09-22  Richard Guenther  <rguenther@suse.de>

	PR pch/38987
	* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.

From-SVN: r151970
This commit is contained in:
Richard Guenther 2009-09-22 08:37:31 +00:00 committed by Richard Biener
parent f61e18ec67
commit 9a8a2b7a38
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-09-22 Richard Guenther <rguenther@suse.de>
PR pch/38987
* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
2009-09-18 Chris Demetriou <cgd@google.com>
PR preprocessor/28435:

View File

@ -288,6 +288,12 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
if (file->name[0] == '\0' || !pfile->cb.valid_pch)
return false;
/* 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)
return false;
flen = strlen (path);
len = flen + sizeof (extension);
pchname = XNEWVEC (char, len);