aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-09-29 09:31:41 +0000
committerNick Clifton <nickc@redhat.com>2009-09-29 09:31:41 +0000
commit616f6cfe440876c14f3ff7e946e7f1b8be428a27 (patch)
treebc4fa064e12466b9725d62e127217f187ce488d2
parentc006c87b436493de27baab2b699de63565f26e2a (diff)
* function.c (current_function_name): If there is no current
function just return "<none>". git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@152269 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/function.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9826735864c..7ab49af44b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-29 Nick Clifton <nickc@redhat.com>
+
+ * function.c (current_function_name): If there is no current
+ function just return "<none>".
+
2009-09-28 Sriraman Tallam <tmsriram@google.com>
* tree-pass.h (register_pass_info): New structure.
diff --git a/gcc/function.c b/gcc/function.c
index aaed57a5de1..35c0cfd609e 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5415,6 +5415,8 @@ reposition_prologue_and_epilogue_notes (void)
const char *
current_function_name (void)
{
+ if (cfun == NULL)
+ return "<none>";
return lang_hooks.decl_printable_name (cfun->decl, 2);
}