stmt.c (set_file_and_line_for_stmt): Don't crash if cfun->stmt isn't set.
authorMark Mitchell <mark@codesourcery.com>
Thu, 17 Feb 2000 20:44:22 +0000 (20:44 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 17 Feb 2000 20:44:22 +0000 (20:44 +0000)
* stmt.c (set_file_and_line_for_stmt): Don't crash if cfun->stmt
isn't set.

From-SVN: r32041

gcc/ChangeLog
gcc/stmt.c

index 79503b724a639c6ddd350ee1a3e8ba51839af946..84f36e5e4df9b36dae84ea2fc317d202bab7daf4 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 1b98bb589e83e0f14d7e841b429bed91a946b91d..0c4117315be32dc213405c213a4292a4c5a9b11d 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.  */