aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-ubsan.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-03-31 20:39:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-03-31 20:39:25 +0200
commit6f3af3562804db0ef656dcc02b1e192c8f7fc8cc (patch)
treebcd8eeb5904c373580e8d225e212003161cc8d72 /gcc/c-family/c-ubsan.h
parent77734296b4b2634ea4b0222cc5d829d0eb99825f (diff)
downloadgcc-6f3af3562804db0ef656dcc02b1e192c8f7fc8cc.zip
gcc-6f3af3562804db0ef656dcc02b1e192c8f7fc8cc.tar.gz
gcc-6f3af3562804db0ef656dcc02b1e192c8f7fc8cc.tar.bz2
re PR sanitizer/79572 (reference binding to null pointer not reported with -fsanitize=undefined)
PR c++/79572 * c-ubsan.h (ubsan_maybe_instrument_reference): Change argument to tree *. * c-ubsan.c (ubsan_maybe_instrument_reference): Likewise. Handle not just NOP_EXPR to REFERENCE_TYPE, but also INTEGER_CST with REFERENCE_TYPE. * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller for NOP_EXPR to REFERENCE_TYPE. * g++.dg/ubsan/null-8.C: New test. From-SVN: r246621
Diffstat (limited to 'gcc/c-family/c-ubsan.h')
-rw-r--r--gcc/c-family/c-ubsan.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-ubsan.h b/gcc/c-family/c-ubsan.h
index dc0897d..3c3ffc7 100644
--- a/gcc/c-family/c-ubsan.h
+++ b/gcc/c-family/c-ubsan.h
@@ -28,7 +28,7 @@ extern tree ubsan_instrument_return (location_t);
extern tree ubsan_instrument_bounds (location_t, tree, tree *, bool);
extern bool ubsan_array_ref_instrumented_p (const_tree);
extern void ubsan_maybe_instrument_array_ref (tree *, bool);
-extern void ubsan_maybe_instrument_reference (tree);
+extern void ubsan_maybe_instrument_reference (tree *);
extern void ubsan_maybe_instrument_member_call (tree, bool);
/* Declare this here as well as in ubsan.h. */