* stmt.c (set_file_and_line_for_stmt): Don't crash if cfun->stmt
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:44:22 +0000 (20:44 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 20:44:22 +0000 (20:44 +0000)
isn't set.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32041 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stmt.c

index 79503b7..84f36e5 100644 (file)
@@ -1,5 +1,8 @@
 2000-02-17  Mark Mitchell  <mark@codesourcery.com>
 
+       * stmt.c (set_file_and_line_for_stmt): Don't crash if cfun->stmt
+       isn't set.
+
        * invoke.texi (-fmessage-length=n): Document.
 
 2000-02-17  Jason Merrill  <jason@casey.cygnus.com>
index 1b98bb5..0c41173 100644 (file)
@@ -641,8 +641,14 @@ set_file_and_line_for_stmt (file, line)
      char *file;
      int line;
 {
-  emit_filename = file;
-  emit_lineno = line;
+  /* If we're outputting an inline function, and we add a line note,
+     there may be no CFUN->STMT information.  So, there's no need to
+     update it.  */
+  if (cfun->stmt)
+    {
+      emit_filename = file;
+      emit_lineno = line;
+    }
 }
 
 /* Emit a no-op instruction.  */