asan.h (asan_sanitize_allocas_p): Declare.
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Thu, 6 Jul 2017 16:05:00 +0000 (16:05 +0000)
committerMaxim Ostapenko <chefmax@gcc.gnu.org>
Thu, 6 Jul 2017 16:05:00 +0000 (19:05 +0300)
commit5094f7d540ff2f8ccbb3b78a0962a07ffa5960cb
treeabe11990d7fbf767d605ed325548aeca19664586
parente3174bdf35c172f69daf08350401aa177f8f1498
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/ChangeLog
gcc/asan.c
gcc/asan.h
gcc/cfgexpand.c
gcc/opts.c
gcc/params.def
gcc/params.h
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/asan/kasan-alloca-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/kasan-alloca-2.c [new file with mode: 0644]