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 474cd7036b560142240eb1178ad7129dc02cb252..c41804ea4c7504252d4f7bfe58ad1a83a9a136c3 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 1405f1cf008975fe76e695c24c4706495079d95b..3c17a583f6231f2593b136ead0788201a3263478 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);
        }