From 9de8fbe1507d8c6e7c9657657a3c05337b8fde23 Mon Sep 17 00:00:00 2001 From: Prathamesh Kulkarni Date: Thu, 7 Jul 2022 22:03:35 +0530 Subject: [PATCH] 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. --- gcc/statistics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/statistics.cc b/gcc/statistics.cc index 6c21415bf65..01ad353e3a9 100644 --- a/gcc/statistics.cc +++ b/gcc/statistics.cc @@ -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)