backport: re PR preprocessor/37215 (ICE on 'gcc -E -dM -fpreprocessed - < /dev/null')

Merged from trunk
        PR preprocessor/37215
        * c-ppoutput.c (preprocess_file): Check for nonempty buffer.

From-SVN: r189019
This commit is contained in:
Kai Tietz 2012-06-27 17:06:16 +02:00 committed by Kai Tietz
parent ba75af7bba
commit 2dcead10b4
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-06-27 Kai Tietz <ktietz@redhat.com>
Merged from trunk
PR preprocessor/37215
* c-ppoutput.c (preprocess_file): Check for nonempty buffer.
2012-06-14 Release Manager
* GCC 4.7.1 released.

View File

@ -86,7 +86,7 @@ preprocess_file (cpp_reader *pfile)
{
/* A successful cpp_read_main_file guarantees that we can call
cpp_scan_nooutput or cpp_get_token next. */
if (flag_no_output)
if (flag_no_output && pfile->buffer)
{
/* Scan -included buffers, then the main file. */
while (pfile->buffer->prev)