]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/20239 (ICE on empty preprocessed input)
authorRichard Guenther <rguenther@suse.de>
Fri, 9 Sep 2005 13:37:03 +0000 (13:37 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 9 Sep 2005 13:37:03 +0000 (13:37 +0000)
2005-09-09  Richard Guenther  <rguenther@suse.de>

PR c/20239
* cppinit.c (cpp_read_main_file): Avoid segfaulting on
NULL pfile->map.

From-SVN: r104096

gcc/ChangeLog
gcc/cppinit.c

index 2b6912beb54ca4bd34c9434eda4d41e2dae005b4..3bb65ce47ef1ed9a6c730378baa56b6015f0bbd6 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-09  Richard Guenther  <rguenther@suse.de>
+
+       PR c/20239
+       * cppinit.c (cpp_read_main_file): Avoid segfaulting on
+       NULL pfile->map.
+
 2005-09-09  Richard Guenther  <rguenther@suse.de>
 
        PR c++/23624
index ae30568699c5b44c8361f2cd80353f1b7dd1786e..b83b6f2528d5d833244ffe67ff9cab6a8cf7f813 100644 (file)
@@ -477,6 +477,8 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
   if (CPP_OPTION (pfile, preprocessed))
     {
       read_original_filename (pfile);
+      if (!pfile->map)
+       return NULL;
       fname = pfile->map->to_file;
     }
   return fname;