diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-12-20 10:05:04 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-12-20 10:05:04 +0100 |
commit | ac0ff9f273ff5d1e11a6ccd79b27f33d592eebd3 (patch) | |
tree | 1532e9443ebd8eec5317be98cd328850b93ce329 /gcc/flag-types.h | |
parent | 634bdae96bb7ff880eeaaf35e6a91e38607a5783 (diff) | |
download | gcc-ac0ff9f273ff5d1e11a6ccd79b27f33d592eebd3.zip gcc-ac0ff9f273ff5d1e11a6ccd79b27f33d592eebd3.tar.gz gcc-ac0ff9f273ff5d1e11a6ccd79b27f33d592eebd3.tar.bz2 |
ubsan.c: Include tree-ssanames.h, asan.h and gimplify-me.h.
* ubsan.c: Include tree-ssanames.h, asan.h and gimplify-me.h.
(ubsan_type_descriptor): Handle BOOLEAN_TYPE and ENUMERAL_TYPE
like INTEGER_TYPE.
(instrument_bool_enum_load): New function.
(ubsan_pass): Call it.
(gate_ubsan): Also enable for SANITIZE_BOOL or SANITIZE_ENUM.
* asan.c (create_cond_insert_point): No longer static.
* asan.h (create_cond_insert_point): Declare.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE): New
built-in.
* opts.c (common_handle_option): Handle -fsanitize=bool and
-fsanitize=enum.
* builtins.c (fold_builtin_memory_op): When sanitizing bool
and enum loads, don't use enum or bool types for memcpy folding.
* flag-types.h (SANITIZE_BOOL, SANITIZE_ENUM): New.
(SANITIZE_UNDEFINED): Or these in.
* c-c++-common/ubsan/load-bool-enum.c: New test.
From-SVN: r206143
Diffstat (limited to 'gcc/flag-types.h')
-rw-r--r-- | gcc/flag-types.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/flag-types.h b/gcc/flag-types.h index bea268f..e4792dd 100644 --- a/gcc/flag-types.h +++ b/gcc/flag-types.h @@ -216,9 +216,11 @@ enum sanitize_code { SANITIZE_NULL = 1 << 7, SANITIZE_RETURN = 1 << 8, SANITIZE_SI_OVERFLOW = 1 << 9, + SANITIZE_BOOL = 1 << 10, + SANITIZE_ENUM = 1 << 11, SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN - | SANITIZE_SI_OVERFLOW + | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM }; /* flag_vtable_verify initialization levels. */ |