Commit 04bfa1e4 by Dmitry Vyukov Committed by Dmitry Vyukov

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

2016-12-08  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).
	* doc/invoke.texi (-fsanitize=kernel-address):
	Don't say that it enables -fsanitize-address-use-after-scope.

From-SVN: r243441
parent 48d73a93
2016-12-08 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).
* doc/invoke.texi (-fsanitize=kernel-address):
Don't say that it enables -fsanitize-address-use-after-scope.
2016-12-08 Bin Cheng <bin.cheng@arm.com> 2016-12-08 Bin Cheng <bin.cheng@arm.com>
PR middle-end/78684 PR middle-end/78684
...@@ -10640,7 +10640,6 @@ The option can't be combined with @option{-fsanitize=thread}. ...@@ -10640,7 +10640,6 @@ The option can't be combined with @option{-fsanitize=thread}.
@item -fsanitize=kernel-address @item -fsanitize=kernel-address
@opindex fsanitize=kernel-address @opindex fsanitize=kernel-address
Enable AddressSanitizer for Linux kernel. Enable AddressSanitizer for Linux kernel.
The option enables @option{-fsanitize-address-use-after-scope}.
See @uref{https://github.com/google/kasan/wiki} for more details. See @uref{https://github.com/google/kasan/wiki} for more details.
@item -fsanitize=thread @item -fsanitize=thread
......
...@@ -990,7 +990,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -990,7 +990,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
/* Enable -fsanitize-address-use-after-scope if address sanitizer is /* Enable -fsanitize-address-use-after-scope if address sanitizer is
enabled. */ enabled. */
if (opts->x_flag_sanitize if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS)
&& !opts_set->x_flag_sanitize_address_use_after_scope) && !opts_set->x_flag_sanitize_address_use_after_scope)
opts->x_flag_sanitize_address_use_after_scope = true; opts->x_flag_sanitize_address_use_after_scope = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment