re PR fortran/85735 (f951 crashes on empty input)
authorMarek Polacek <polacek@redhat.com>
Thu, 10 May 2018 18:33:22 +0000 (18:33 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 10 May 2018 18:33:22 +0000 (18:33 +0000)
PR fortran/85735
* options.c (gfc_post_options): Set main_input_filename.

From-SVN: r260120

gcc/fortran/ChangeLog
gcc/fortran/options.c

index 474cd70..c41804e 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-10  Marek Polacek  <polacek@redhat.com>
+
+       PR fortran/85735
+       * options.c (gfc_post_options): Set main_input_filename.
+
 2018-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/54613
index 1405f1c..3c17a58 100644 (file)
@@ -313,6 +313,7 @@ gfc_post_options (const char **pfilename)
       if (gfc_current_form == FORM_UNKNOWN)
        {
          gfc_current_form = FORM_FREE;
+         main_input_filename = filename;
          gfc_warning_now (0, "Reading file %qs as free form", 
                           (filename[0] == '\0') ? "<stdin>" : filename);
        }