From 5094f7d540ff2f8ccbb3b78a0962a07ffa5960cb Mon Sep 17 00:00:00 2001 From: Maxim Ostapenko Date: Thu, 6 Jul 2017 16:05:00 +0000 Subject: asan.h (asan_sanitize_allocas_p): Declare. gcc/ * asan.h (asan_sanitize_allocas_p): Declare. * asan.c (asan_sanitize_allocas_p): New function. (handle_builtin_stack_restore): Bail out if !asan_sanitize_allocas_p. (handle_builtin_alloca): Likewise. * cfgexpand.c (expand_used_vars): Do not add allocas unpoisoning stuff if !asan_sanitize_allocas_p. * params.def (asan-instrument-allocas): Add new option. * params.h (ASAN_PROTECT_ALLOCAS): Define. * opts.c (common_handle_option): Disable allocas sanitization for KASan by default. gcc/testsuite/ * c-c++-common/asan/kasan-alloca-1.c: New test. * c-c++-common/asan/kasan-alloca-2.c: Likewise. From-SVN: r250032 --- gcc/asan.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/asan.h') diff --git a/gcc/asan.h b/gcc/asan.h index 4e8120e..c82d4d9 100644 --- a/gcc/asan.h +++ b/gcc/asan.h @@ -108,6 +108,8 @@ extern void set_sanitized_sections (const char *); extern bool asan_sanitize_stack_p (void); +extern bool asan_sanitize_allocas_p (void); + /* Return TRUE if builtin with given FCODE will be intercepted by libasan. */ -- cgit v1.1