On Thu, Feb 18, 2016 at 01:02:05PM +0100, Martin Liška wrote:
> gcc/ChangeLog:
> 
> 2016-02-18  Jakub Jelinek  <ja...@redhat.com>
>           Martin Liska  <mli...@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

Reply via email to