re PR preprocessor/37215 (ICE on 'gcc -E -dM -fpreprocessed - < /dev/null')
authorKai Tietz <ktietz@redhat.com>
Wed, 27 Jun 2012 14:03:08 +0000 (16:03 +0200)
committerKai Tietz <ktietz@gcc.gnu.org>
Wed, 27 Jun 2012 14:03:08 +0000 (16:03 +0200)
        PR preprocessor/37215
        * c-ppoutput.c (preprocess_file): Check for nonempty buffer.

From-SVN: r189016

gcc/c-family/ChangeLog
gcc/c-family/c-ppoutput.c

index 056f2ae5ec14acf15bbe18dbaf1027d8f18a18e6..dbab100bbf3ea178745daf26008633a215d5c79e 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-27  Kai Tietz  <ktietz@redhat.com>
+
+       PR preprocessor/37215
+       * c-ppoutput.c (preprocess_file): Check for nonempty buffer.
+
 2012-06-21  Steven Bosscher  <steven@gcc.gnu.org>
 
        * c-common.h (c_common_print_pch_checksum): Remove.
index df46ce4c1f552c29e34ffafcf670608683b9d54d..862d15d5885b7c35f20277ba871a242ddb85e7e2 100644 (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)