OSDN Git Service

2010-10-11 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Oct 2010 20:23:04 +0000 (20:23 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Oct 2010 20:23:04 +0000 (20:23 +0000)
PR c++/45562
* cp/cp-tree.h (current_class_ref): Check that cp_function_chain is
non-NULL.
* cp/call.c (build_cxx_call): Likewise.

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

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h

index 6d4095c..5b08906 100644 (file)
@@ -1,3 +1,10 @@
+2010-10-11  Martin Jambor  <mjambor@suse.cz>
+
+       PR c++/45562
+       * cp-tree.h (current_class_ref): Check that cp_function_chain is
+       non-NULL.
+       * call.c (build_cxx_call): Likewise.
+
 2010-10-10  Jason Merrill  <jason@redhat.com>
 
        * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
index e0911ac..d323191 100644 (file)
@@ -6082,7 +6082,8 @@ build_cxx_call (tree fn, int nargs, tree *argarray)
   fndecl = get_callee_fndecl (fn);
   if ((!fndecl || !TREE_NOTHROW (fndecl))
       && at_function_scope_p ()
-      && cfun)
+      && cfun
+      && cp_function_chain)
     cp_function_chain->can_throw = 1;
 
   /* Check that arguments to builtin functions match the expectations.  */
index e4f2412..bfc6fd3 100644 (file)
@@ -1055,7 +1055,8 @@ struct GTY(()) language_function {
   (cfun && cp_function_chain                                   \
    ? cp_function_chain->x_current_class_ptr : NULL_TREE)
 #define current_class_ref \
-  (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
+  ((cfun && cp_function_chain)                                  \
+   ? cp_function_chain->x_current_class_ref : NULL_TREE)
 
 /* The EH_SPEC_BLOCK for the exception-specifiers for the current
    function, if any.  */