diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-11-22 21:07:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-11-22 21:07:31 +0100 |
commit | 0a508bb66b6056dd7a7cd7a689daa1b1dfff6863 (patch) | |
tree | 27f73f1a16fc3ef2b2d49ac81210b2c02c06ba3f /gcc/flag-types.h | |
parent | 59b36ecf239ba0164f55a2ac2cd37154d7963dd9 (diff) | |
download | gcc-0a508bb66b6056dd7a7cd7a689daa1b1dfff6863.zip gcc-0a508bb66b6056dd7a7cd7a689daa1b1dfff6863.tar.gz gcc-0a508bb66b6056dd7a7cd7a689daa1b1dfff6863.tar.bz2 |
ubsan.c (ubsan_source_location): Don't crash on unknown locations.
* ubsan.c (ubsan_source_location): Don't crash on
unknown locations.
(ubsan_pass): Ignore clobber stmts.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_MISSING_RETURN): New built-in.
* opts.c (common_handle_option): Add -fsanitize=return.
* flag-types.h (enum sanitize_code): Add SANITIZE_RETURN and
or it into SANITIZE_UNDEFINED.
c-family/
* c-ubsan.h (ubsan_instrument_return): New prototype.
* c-ubsan.c (ubsan_instrument_return): New function.
cp/
* cp-gimplify.c: Include target.h and c-family/c-ubsan.h.
(cp_ubsan_maybe_instrument_return): New function.
(cp_genericize): Call it if -fsanitize=return.
testsuite/
* g++.dg/ubsan/return-1.C: New test.
* g++.dg/ubsan/return-2.C: New test.
From-SVN: r205283
Diffstat (limited to 'gcc/flag-types.h')
-rw-r--r-- | gcc/flag-types.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/flag-types.h b/gcc/flag-types.h index 528c88a..1d85a9a 100644 --- a/gcc/flag-types.h +++ b/gcc/flag-types.h @@ -212,8 +212,9 @@ enum sanitize_code { SANITIZE_UNREACHABLE = 1 << 4, SANITIZE_VLA = 1 << 5, SANITIZE_NULL = 1 << 6, + SANITIZE_RETURN = 1 << 7, SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE - | SANITIZE_VLA | SANITIZE_NULL + | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN }; /* flag_vtable_verify initialization levels. */ |