summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2010-02-07 07:45:55 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2010-02-07 07:45:55 +0000
commit6c076a6c42817b0462e8e22897bf8a398ca53ca9 (patch)
treeb0d2e2afeabbe787c74af74e7e81d64b46ac1136 /libgfortran
parente8583d3ae1588677f18d51f079b26a28c297cc13 (diff)
downloadgcc-6c076a6c42817b0462e8e22897bf8a398ca53ca9.tar.gz
re PR libfortran/42742 (Handle very large format strings correctly)
2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/42742 * io/format.c (reset_fnode_counters): Use the correct pointer to the head of the fnode list. (parse_format): Remove previous hack that set limit on size of format string for caching. From-SVN: r156568
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/io/format.c7
2 files changed, 9 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index be54763e96f..3f52e5f99bf 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,12 @@
2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ PR libfortran/42742
+ * io/format.c (reset_fnode_counters): Use the correct pointer to the
+ head of the fnode list. (parse_format): Remove previous hack that set
+ limit on size of format string for caching.
+
+2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
PR libfortran
* io/transfer.c (read_sf): Handle EOR and EOF conditions for
ADVANCE="no" with PAD="yes" or PAD="no".
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 13516d2f8a6..68b9e992d6d 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -130,7 +130,7 @@ reset_fnode_counters (st_parameter_dt *dtp)
/* Clear this pointer at the head so things start at the right place. */
fmt->array.array[0].current = NULL;
- for (f = fmt->last->array[0].u.child; f; f = f->next)
+ for (f = fmt->array.array[0].u.child; f; f = f->next)
reset_node (f);
}
@@ -1212,8 +1212,6 @@ revert (st_parameter_dt *dtp)
/* parse_format()-- Parse a format string. */
-#define FORMAT_CACHE_STRING_LIMIT 256
-
void
parse_format (st_parameter_dt *dtp)
{
@@ -1222,8 +1220,7 @@ parse_format (st_parameter_dt *dtp)
/* Don't cache for internal units and set an arbitrary limit on the size of
format strings we will cache. (Avoids memory issues.) */
- format_cache_ok = !is_internal_unit (dtp)
- && (dtp->format_len < FORMAT_CACHE_STRING_LIMIT );
+ format_cache_ok = !is_internal_unit (dtp);
/* Lookup format string to see if it has already been parsed. */
if (format_cache_ok)