Rimvydas (RJ)

2017-10-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Rimvydas (RJ)

	Backport from trunk
	PR libgfortran/81938
	io/format.c (free_format_data): Don't try to free vlist
	descriptors past the end of the fnode array.

From-SVN: r254169
This commit is contained in:
Jerry DeLisle 2017-10-27 18:51:35 +00:00
parent dba9a0fe80
commit ee3ac71709
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2017-10-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Rimvydas (RJ)
Backport from trunk
PR libgfortran/81938
io/format.c (free_format_data): Don't try to free vlist
descriptors past the end of the fnode array.
2017-10-19 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk

View File

@ -266,7 +266,8 @@ free_format_data (format_data *fmt)
return;
/* Free vlist descriptors in the fnode_array if one was allocated. */
for (fnp = fmt->array.array; fnp->format != FMT_NONE; fnp++)
for (fnp = fmt->array.array; fnp < &fmt->array.array[FARRAY_SIZE] &&
fnp->format != FMT_NONE; fnp++)
if (fnp->format == FMT_DT)
{
if (GFC_DESCRIPTOR_DATA(fnp->u.udf.vlist))