summaryrefslogtreecommitdiff
path: root/gcc/asan.c
diff options
context:
space:
mode:
authorchefmax <chefmax@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 09:15:13 +0000
committerchefmax <chefmax@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 09:15:13 +0000
commit21017ecb28043065575a4e269837858b5b54eb0a (patch)
treef7c62c92ce48c00bad27d1fa88ecde0728255afa /gcc/asan.c
parent1924dd8eacd8f2aea74c92be1e4bedb5a0bef2c5 (diff)
downloadgcc-21017ecb28043065575a4e269837858b5b54eb0a.tar.gz
libsanitizer merge from upstream r253555, compiler part.
gcc/ * opts.c (finish_options): Allow -fsanitize-recover=address for userspace sanitization. * asan.c (asan_expand_check_ifn): Redefine recover_p. * doc/invoke.texi (fsanitize-recover): Update documentation. gcc/testsuite/ * c-c++-common/asan/halt_on_error-1.c: New test. * c-c++-common/asan/halt_on_error-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230741 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/asan.c')
-rw-r--r--gcc/asan.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/asan.c b/gcc/asan.c
index 0df5e3234b5..6d9a8030fa2 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2533,9 +2533,11 @@ asan_expand_check_ifn (gimple_stmt_iterator *iter, bool use_calls)
{
gimple *g = gsi_stmt (*iter);
location_t loc = gimple_location (g);
-
- bool recover_p
- = (flag_sanitize & flag_sanitize_recover & SANITIZE_KERNEL_ADDRESS) != 0;
+ bool recover_p;
+ if (flag_sanitize & SANITIZE_USER_ADDRESS)
+ recover_p = (flag_sanitize_recover & SANITIZE_USER_ADDRESS) != 0;
+ else
+ recover_p = (flag_sanitize_recover & SANITIZE_KERNEL_ADDRESS) != 0;
HOST_WIDE_INT flags = tree_to_shwi (gimple_call_arg (g, 0));
gcc_assert (flags < ASAN_CHECK_LAST);