decl2.c (mark_used): Don't segfault if cfun != NULL but current_function_decl ==...
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Apr 2004 13:38:00 +0000 (15:38 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 8 Apr 2004 13:38:00 +0000 (15:38 +0200)
* decl2.c (mark_used): Don't segfault if cfun != NULL but
current_function_decl == NULL.

From-SVN: r80506

gcc/cp/ChangeLog
gcc/cp/decl2.c

index d183371978e287507ceae9b6ba1f06197b98f6f0..d1873a8a20aa9fdc51249281137aa3550151ed55 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-08  Jakub Jelinek  <jakub@redhat.com>
+
+       * decl2.c (mark_used): Don't segfault if cfun != NULL but
+       current_function_decl == NULL.
+
 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/3518
index 0a4e8e9d0d270297ddb487a6257705421dd1b05c..de09eb692613432c644b9ec485202ff5226d9804 100644 (file)
@@ -3030,6 +3030,7 @@ mark_used (tree decl)
                  generate its body to find that out.  */
               || TREE_NOTHROW (decl)
               || !cfun
+              || !current_function_decl
               /* If we already know the current function can't throw,
                  then we don't need to work hard to prove it.  */
               || TREE_NOTHROW (current_function_decl)