From 2418d0e0e6ed901760e8eed1bd44bfc3420d8b28 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 9 Jul 2009 01:20:23 +0000 Subject: re PR libfortran/40330 (incorrect IO) 2009-07-08 Jerry DeLisle PR libfortran/40330 PR libfortran/40662 * io/io.h (st_parameter_dt): Define format_not_saved bit used to signal whether the parsed format data was previously saved. Used to determine if the current format data should be freed or not. * io/transfer.c (st_read_done): Use the format_not_saved bit. (st_write_done): Likewise. * io/format.c (parse_format_list): Add boolean pointer to arg list. This pointer is used to return status to the caller regarding whether it is safe to cache the parsed format data. Currently, if a FMT_STRING token is encounetered, it is not safe to cache. Also, added a local boolean variable to hold this information as recursive calls to parse_format_list are made. Remove previous save_format logic. (parse_format): Do not use the format caching facility if the current unit is an internal unit or if it is not safe to save parsed format data. From-SVN: r149398 --- libgfortran/io/io.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libgfortran/io/io.h') diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 9e1e45e..088969a 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -481,7 +481,9 @@ typedef struct st_parameter_dt unsigned at_eof : 1; /* Used for g0 floating point output. */ unsigned g0_no_blanks : 1; - /* 15 unused bits. */ + /* Used to signal use of free_format_data. */ + unsigned format_not_saved : 1; + /* 14 unused bits. */ char last_char; char nml_delim; -- cgit v1.1