aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2022-07-07 22:03:35 +0530
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2022-07-07 22:05:09 +0530
commit9de8fbe1507d8c6e7c9657657a3c05337b8fde23 (patch)
tree591f848f82d6d517914ab50d3ff781d559029829
parent81bec060e31b6ef2feeb3046c6f13a207c6f698a (diff)
downloadgcc-9de8fbe1507d8c6e7c9657657a3c05337b8fde23.zip
gcc-9de8fbe1507d8c6e7c9657657a3c05337b8fde23.tar.gz
gcc-9de8fbe1507d8c6e7c9657657a3c05337b8fde23.tar.bz2
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.
-rw-r--r--gcc/statistics.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/statistics.cc b/gcc/statistics.cc
index 6c21415..01ad353 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)