]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (output_line_info): Don't try to dereference a NULL current_function_decl.
authorGeoffrey Keating <geoffk@apple.com>
Tue, 12 Apr 2005 01:45:43 +0000 (01:45 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 12 Apr 2005 01:45:43 +0000 (01:45 +0000)
* dwarf2out.c (output_line_info): Don't try to dereference
a NULL current_function_decl.

From-SVN: r98000

gcc/ChangeLog
gcc/dwarf2out.c

index bc5f1a31c7ef994924ebafe3dafed5eee013ac72..09b82ceb63c15c9c4b990ce6ef6caa93594957d2 100644 (file)
@@ -26,6 +26,9 @@
        
 2005-04-11  Geoffrey Keating  <geoffk@apple.com>
 
+       * dwarf2out.c (output_line_info): Don't try to dereference
+       a NULL current_function_decl.
+
        * config/t-slibgcc-darwin: Don't put shared libraries in
        directories other than $(slibdir).
        * config/rs6000/darwin.h: Find -m64 libgcc under the name the
index a7b2b86a0098f1ad0995f4670d5bbb648c174840..aebefd4e29c358332e5cbe1a5b11374ca25c93f5 100644 (file)
@@ -7662,7 +7662,7 @@ output_line_info (void)
   long line_delta;
   unsigned long current_file;
   unsigned long function;
-  struct function *cfun = DECL_STRUCT_FUNCTION (current_function_decl);
+  struct function *cfun;
 
   ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, 0);
   ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, 0);
@@ -7732,6 +7732,11 @@ output_line_info (void)
      a series of state machine operations.  */
   current_file = 1;
   current_line = 1;
+  
+  if (current_function_decl)
+    cfun = DECL_STRUCT_FUNCTION (current_function_decl);
+  else
+    cfun = NULL;
   if (last_text_section == in_unlikely_executed_text
       || (last_text_section == in_named
          && last_text_section_name == cfun->unlikely_text_section_name))