Commit 6c076a6c by Jerry DeLisle

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
parent e8583d3a
2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> 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 PR libfortran
* io/transfer.c (read_sf): Handle EOR and EOF conditions for * io/transfer.c (read_sf): Handle EOR and EOF conditions for
ADVANCE="no" with PAD="yes" or PAD="no". ADVANCE="no" with PAD="yes" or PAD="no".
......
...@@ -130,7 +130,7 @@ reset_fnode_counters (st_parameter_dt *dtp) ...@@ -130,7 +130,7 @@ reset_fnode_counters (st_parameter_dt *dtp)
/* Clear this pointer at the head so things start at the right place. */ /* Clear this pointer at the head so things start at the right place. */
fmt->array.array[0].current = NULL; 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); reset_node (f);
} }
...@@ -1212,8 +1212,6 @@ revert (st_parameter_dt *dtp) ...@@ -1212,8 +1212,6 @@ revert (st_parameter_dt *dtp)
/* parse_format()-- Parse a format string. */ /* parse_format()-- Parse a format string. */
#define FORMAT_CACHE_STRING_LIMIT 256
void void
parse_format (st_parameter_dt *dtp) parse_format (st_parameter_dt *dtp)
{ {
...@@ -1222,8 +1220,7 @@ 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 /* Don't cache for internal units and set an arbitrary limit on the size of
format strings we will cache. (Avoids memory issues.) */ format strings we will cache. (Avoids memory issues.) */
format_cache_ok = !is_internal_unit (dtp) format_cache_ok = !is_internal_unit (dtp);
&& (dtp->format_len < FORMAT_CACHE_STRING_LIMIT );
/* Lookup format string to see if it has already been parsed. */ /* Lookup format string to see if it has already been parsed. */
if (format_cache_ok) if (format_cache_ok)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment