statistics.cc: Add check to see if fn is not NULL in get_function_name.

gcc/ChangeLog:

	* statistics.cc (get_function_name): Add check to see if fn is not NULL.
This commit is contained in:
Prathamesh Kulkarni 2022-07-07 22:03:35 +05:30
parent 81bec060e3
commit 9de8fbe150

View File

@ -121,7 +121,7 @@ static const char *
get_function_name (struct function *fn)
{
if ((statistics_dump_flags & TDF_ASMNAME)
&& DECL_ASSEMBLER_NAME_SET_P (fn->decl))
&& fn && DECL_ASSEMBLER_NAME_SET_P (fn->decl))
{
tree asmname = decl_assembler_name (fn->decl);
if (asmname)