diff options
author | Marek Polacek <polacek@redhat.com> | 2014-12-01 15:29:11 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-12-01 15:29:11 +0000 |
commit | 0b274c179f478df449d66bd0707cb9aa05dcafed (patch) | |
tree | ab16ac18207414d807131a6cc0d31d9904341699 /gcc/cp/error.c | |
parent | e42c407c8ad2b2bf30fdfab1f7cb6948f1949f38 (diff) | |
download | gcc-0b274c179f478df449d66bd0707cb9aa05dcafed.zip gcc-0b274c179f478df449d66bd0707cb9aa05dcafed.tar.gz gcc-0b274c179f478df449d66bd0707cb9aa05dcafed.tar.bz2 |
re PR sanitizer/63956 ([UBSAN] ICE segfault in cxx_eval_call_expression ../../gcc/cp/constexpr.c)
PR sanitizer/63956
* ubsan.c (is_ubsan_builtin_p): Check also built-in class.
cp/
* constexpr.c: Include ubsan.h.
(cxx_eval_call_expression): Bail out for IFN_UBSAN_{NULL,BOUNDS}
internal functions and for ubsan builtins.
* error.c: Include internal-fn.h.
(dump_expr): Add printing of internal functions.
testsuite/
* c-c++-common/ubsan/shift-5.c: Add xfails.
* g++.dg/ubsan/div-by-zero-1.C: Don't use -w. Add xfail.
* g++.dg/ubsan/pr63956.C: New test.
From-SVN: r218221
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 5dcc149..ff26fb9 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "c-family/c-objc.h" #include "ubsan.h" +#include "internal-fn.h" #include <new> // For placement-new. @@ -2039,6 +2040,14 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) tree fn = CALL_EXPR_FN (t); bool skipfirst = false; + /* Deal with internal functions. */ + if (fn == NULL_TREE) + { + pp_string (pp, internal_fn_name (CALL_EXPR_IFN (t))); + dump_call_expr_args (pp, t, flags, skipfirst); + break; + } + if (TREE_CODE (fn) == ADDR_EXPR) fn = TREE_OPERAND (fn, 0); |