[PATCH, gfortran] Fix initialization of arrays of strings

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Jul 11 02:44:00 GMT 2005


On Sun, Jul 10, 2005 at 07:04:09PM -0700, Steve Kargl wrote:
> --- 756,771 ----
>   		gfc_set_constant_character_len (len, init);
>   	      else if (init->expr_type == EXPR_ARRAY)
>   		{
> ! 		  if (init->ts.cl == NULL)
> ! 		    {
> ! 		      init->ts.cl = gfc_get_charlen ();
> ! 		      init->ts.cl->length = gfc_copy_expr (sym->ts.cl->length);

In looking at the patch, I just realized the above line isn't 
needed.  I have new patch without this line.

> ! 		    }
> ! 		  else if (init->ts.cl->length != NULL)
> ! 		      gfc_free_expr (init->ts.cl->length);
> ! 
>   		  init->ts.cl->length = gfc_copy_expr (sym->ts.cl->length);
> + 
>   		  for (p = init->value.constructor; p; p = p->next)
>   		    gfc_set_constant_character_len (len, p->expr);
>   		}


Also, I hve bubblestrap and regtested on i386-*-freebsd.

-- 
Steve



More information about the Fortran mailing list