[patch, fortran] PR93473 - ICE on valid with long module + submodule names

Tobias Burnus tobias@codesourcery.com
Tue Jan 28 08:57:00 GMT 2020


On 1/28/20 12:41 AM, Andrew Benson wrote:
> The problem occurs in set_syms_host_assoc() where the "parent1" and "parent2"
> variables have a maximum length of GFC_MAX_SYMBOL_LEN+1. This is insufficient
> when the parent names are a module+submodule name concatenated with a ".". The
> patch above fixes this by increasing their length to 2*GFC_MAX_SYMBOL_LEN+2.
>
> A patch to fix this is attached. The patch regression tests cleanly - ok to
> commit?

The patch is okay, but can you add a comment – similar to the other 
patch – which makes clear why one needs twice the normal 
GFC_MAX_SYMBOL_LEN (+2)? You currently have:

>     const char dot[2] = ".";
> -  char parent1[GFC_MAX_SYMBOL_LEN + 1];
> -  char parent2[GFC_MAX_SYMBOL_LEN + 1];
> +  char parent1[2 * GFC_MAX_SYMBOL_LEN + 2];
> +  char parent2[2 * GFC_MAX_SYMBOL_LEN + 2];

Tobias




More information about the Gcc-patches mailing list