This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not emit red stack zones for a fn with no_sanitize_address (PR sanitizer/69863)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin LiÅka <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 18 Feb 2016 13:59:39 +0100
- Subject: Re: [PATCH] Do not emit red stack zones for a fn with no_sanitize_address (PR sanitizer/69863)
- Authentication-results: sourceware.org; auth=none
- References: <56C5B2BD dot 5090904 at suse dot cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Feb 18, 2016 at 01:02:05PM +0100, Martin LiÅka wrote:
> gcc/ChangeLog:
>
> 2016-02-18 Jakub Jelinek <jakub@redhat.com>
> Martin Liska <mliska@suse.cz>
>
> PR sanitizer/69863
> * cfgexpand.c (asan_sanitize_stack_p): New function.
> (partition_stack_vars): Use the function.
> (expand_stack_vars): Likewise.
> (defer_stack_allocation): Likewise.
> (expand_used_vars): Likewise.
> ---
> gcc/cfgexpand.c | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
> index 4ac8421..d7cb896 100644
> --- a/gcc/cfgexpand.c
> +++ b/gcc/cfgexpand.c
> @@ -868,6 +868,18 @@ union_stack_vars (size_t a, size_t b)
> }
> }
>
> +/* Return true if a current function should be annotated for ASAN stack
a/a/the/
s/annotated/instrumented/, perhaps better
/* Return true if the current function should have its stack frame
protected by address sanitizer. */
> + protection. */
> +
> +static inline bool
> +asan_sanitize_stack_p (void)
> +{
> + return (flag_sanitize & SANITIZE_ADDRESS)
> + && ASAN_STACK
> + && !lookup_attribute ("no_sanitize_address",
> + DECL_ATTRIBUTES (current_function_decl));
> +}
Please fix up formatting here, the && should be aligned below flag_sanitize,
like:
return ((flag_sanitize & SANITIZE_ADDRESS)
&& ASAN_STACK
&& !lookup_attribute ("no_sanitize_address",
DECL_ATTRIBUTES (current_function_decl)));
Ok for trunk with those changes.
Jakub