diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9826735864cc..7ab49af44b07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-09-29 Nick Clifton + + * function.c (current_function_name): If there is no current + function just return "". + 2009-09-28 Sriraman Tallam * tree-pass.h (register_pass_info): New structure. diff --git a/gcc/function.c b/gcc/function.c index aaed57a5de1b..35c0cfd609e8 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 ""; return lang_hooks.decl_printable_name (cfun->decl, 2); }