gcc/libsanitizer/ubsan
Jakub Jelinek 126edc3fe2 flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE and SANITIZE_RETURNS_NONNULL_ATTRIBUTE...
gcc/
	* flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE
	and SANITIZE_RETURNS_NONNULL_ATTRIBUTE, or them into SANITIZE_UNDEFINED.
	* opts.c (common_handle_option): Handle SANITIZE_NONNULL_ATTRIBUTE and
	SANITIZE_RETURNS_NONNULL_ATTRIBUTE and disable
	flag_delete_null_pointer_checks for them.
	* sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
	BUILT_IN_UBSAN_HANDLE_NONNULL_ARG_ABORT,
	BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
	BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): New.
	* ubsan.c (instrument_bool_enum_load): Set *gsi back to
	stmt's iterator.
	(instrument_nonnull_arg, instrument_nonnull_return): New functions.
	(pass_ubsan::gate): Return true even for SANITIZE_NONNULL_ATTRIBUTE
	or SANITIZE_RETURNS_NONNULL_ATTRIBUTE.
	(pass_ubsan::execute): Call instrument_nonnull_{arg,return}.
	* doc/invoke.texi (-fsanitize=nonnull-attribute,
	-fsanitize=returns-nonnull-attribute): Document.
gcc/testsuite/
	* c-c++-common/ubsan/attrib-3.c: New test.
	* c-c++-common/ubsan/nonnull-1.c: New test.
	* c-c++-common/ubsan/nonnull-2.c: New test.
	* c-c++-common/ubsan/nonnull-3.c: New test.
	* c-c++-common/ubsan/nonnull-4.c: New test.
	* c-c++-common/ubsan/nonnull-5.c: New test.
libsanitizer/
	* ubsan/ubsan_handlers.cc, ubsan/ubsan_handlers.h: Cherry pick
	upstream r215485, r217389, r217391 and r217400.

From-SVN: r215118
2014-09-10 11:23:16 +02:00
..
libtool-version
Makefile.am re PR sanitizer/59136 (llvm-symbolizer shouldn't be started always) 2014-01-09 19:13:39 +01:00
Makefile.in re PR sanitizer/59136 (llvm-symbolizer shouldn't be started always) 2014-01-09 19:13:39 +01:00
ubsan_diag.cc libsanitizer merge from upstream r209283 2014-05-22 07:09:21 +00:00
ubsan_diag.h libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_handlers_cxx.cc
ubsan_handlers_cxx.h
ubsan_handlers.cc flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE and SANITIZE_RETURNS_NONNULL_ATTRIBUTE... 2014-09-10 11:23:16 +02:00
ubsan_handlers.h flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE and SANITIZE_RETURNS_NONNULL_ATTRIBUTE... 2014-09-10 11:23:16 +02:00
ubsan_type_hash.cc libsanitizer merge from upstream r196090 2013-12-05 09:18:38 +00:00
ubsan_type_hash.h
ubsan_value.cc builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT. 2014-05-23 14:44:42 +00:00
ubsan_value.h libsanitizer merge from upstream r209283 2014-05-22 07:09:21 +00:00