> --- a/gcc/fortran/decl.c
> +++ b/gcc/fortran/decl.c
> @@ -2995,7 +2995,7 @@ gfc_match_import (void)
>                gfc_error ("Type name '%s' at %C is ambiguous", name);
>                return MATCH_ERROR;
>             }
> -         else if (gfc_current_ns->proc_name->ns->parent !=  NULL
> +         else if (!sym && gfc_current_ns->proc_name->ns->parent !=  NULL
>                    && gfc_find_symbol (name,
>                                        gfc_current_ns->proc_name->ns-
>parent,
>                                        1, &sym))
> 
I think sym could be used uninitialized.
In the if condition before, if gfc_current_ns->parent ==  NULL, the call to 
gfc_find_symbol (which either sets or clears sym) is skipped.
If you clear sym in the declaration, your patch is probably useless (not sure 
however, as there is a loop around the whole lot). 
I have the feeling that sym should be cleared first thing in the loop body. 

Mikael

Reply via email to