[PATCH] Enable -fsanitize-address-use-after-scope only if -fsanitize=address is enabled

Jakub Jelinek jakub@redhat.com
Wed Dec 7 18:47:00 GMT 2016


On Wed, Dec 07, 2016 at 07:44:39PM +0100, Dmitry Vyukov wrote:
> OK for trunk?

> Index: gcc/ChangeLog
> ===================================================================
> --- gcc/ChangeLog	(revision 243344)
> +++ gcc/ChangeLog	(working copy)
> @@ -1,3 +1,10 @@
> +2016-12-07  Dmitry Vyukov  <dvyukov@google.com>
> +
> +	* opts.c (finish_options): Enable
> +	-fsanitize-address-use-after-scope only if
> +	-fsanitize=address is enabled (not
> +	-fsanitize=kernel-address).
> +
>  2016-12-07  Bin Cheng  <bin.cheng@arm.com>
>  
>  	PR tree-optimization/78691

Ok, thanks.

> Index: gcc/opts.c
> ===================================================================
> --- gcc/opts.c	(revision 243344)
> +++ gcc/opts.c	(working copy)
> @@ -990,7 +990,7 @@
>  
>    /* Enable -fsanitize-address-use-after-scope if address sanitizer is
>       enabled.  */
> -  if (opts->x_flag_sanitize
> +  if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS)
>        && !opts_set->x_flag_sanitize_address_use_after_scope)
>      opts->x_flag_sanitize_address_use_after_scope = true;
>  


	Jakub



More information about the Gcc-patches mailing list