aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-ubsan.h
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2013-11-03 17:59:31 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2013-11-03 17:59:31 +0000
commitb906f4ca813779c4df4a9449700e8f52022f757f (patch)
tree47ea0e1220f5468397f6fdb89cae25257bd9e763 /gcc/c-family/c-ubsan.h
parent612211412cdcd9112fb2538f2a2bbc5a18c2d16d (diff)
downloadgcc-b906f4ca813779c4df4a9449700e8f52022f757f.zip
gcc-b906f4ca813779c4df4a9449700e8f52022f757f.tar.gz
gcc-b906f4ca813779c4df4a9449700e8f52022f757f.tar.bz2
Implement -fsanitize=vla-bound.
* opts.c (common_handle_option): Handle vla-bound. * sanitizer.def (BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE): Define. * flag-types.h (enum sanitize_code): Add SANITIZE_VLA. * asan.c (initialize_sanitizer_builtins): Build BT_FN_VOID_PTR_PTR. c-family/ * c-ubsan.c: Don't include hash-table.h. (ubsan_instrument_vla): New function. * c-ubsan.h: Declare it. cp/ * decl.c (cp_finish_decl): Move C++1y bounds checking... (compute_array_index_type): ...here. Add VLA instrumentation. Call stabilize_vla_size. (grokdeclarator): Don't call stabilize_vla_size here. c/ * c-decl.c (grokdeclarator): Add VLA instrumentation. testsuite/ * g++.dg/ubsan/cxx1y-vla.C: New test. * c-c++-common/ubsan/vla-3.c: New test. * c-c++-common/ubsan/vla-2.c: New test. * c-c++-common/ubsan/vla-4.c: New test. * c-c++-common/ubsan/vla-1.c: New test. From-SVN: r204334
Diffstat (limited to 'gcc/c-family/c-ubsan.h')
-rw-r--r--gcc/c-family/c-ubsan.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c-family/c-ubsan.h b/gcc/c-family/c-ubsan.h
index b032b70..fdf27d9 100644
--- a/gcc/c-family/c-ubsan.h
+++ b/gcc/c-family/c-ubsan.h
@@ -23,5 +23,6 @@ along with GCC; see the file COPYING3. If not see
extern tree ubsan_instrument_division (location_t, tree, tree);
extern tree ubsan_instrument_shift (location_t, enum tree_code, tree, tree);
+extern tree ubsan_instrument_vla (location_t, tree);
#endif /* GCC_C_UBSAN_H */