OSDN Git Service

* gfortran.h (new): Remove macro.
[pf3gnuchains/gcc-fork.git] / gcc / fortran / scanner.c
index 44e6d86..6e6017a 100644 (file)
@@ -1652,7 +1652,9 @@ preprocessor_line (gfc_char_t *c)
 
   if (strcmp (current_file->filename, filename) != 0)
     {
-      gfc_free (current_file->filename);
+       /* FIXME: we leak the old filename because a pointer to it may be stored
+          in the linemap.  Alternative could be using GC or updating linemap to
+          point to the new name, but there is no API for that currently. */
       current_file->filename = xstrdup (filename);
     }
 
@@ -1838,11 +1840,11 @@ load_file (const char *filename, bool initial)
                                && line[2] == (unsigned char) '\xBF')))
        {
          int n = line[1] == (unsigned char) '\xBB' ? 3 : 2;
-         gfc_char_t *new = gfc_get_wide_string (line_len);
+         gfc_char_t *new_char = gfc_get_wide_string (line_len);
 
-         wide_strcpy (new, &line[n]);
+         wide_strcpy (new_char, &line[n]);
          gfc_free (line);
-         line = new;
+         line = new_char;
          len -= n;
        }