re PR target/67484 (options-save.c sanitizer asan detects freed storage referenced heap-use-after-free)

Fix PR target/67484

	    Uros Bizjak  <ubizjak@gmail.com>

	PR target/67484
	* config/i386/i386.c (ix86_valid_target_attribute_tree):
	Use ggc_strdup to copy option_strings to opts->x_ix86_arch_string and
	opts->x_ix86_tune_string.

From-SVN: r231556
This commit is contained in:
Martin Liska 2015-12-11 11:59:29 +01:00 committed by Martin Liska
parent 9276b0f797
commit 11b9b5a445
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2015-12-11 Martin Liska <mliska@suse.cz>
Uros Bizjak <ubizjak@gmail.com>
PR target/67484
* config/i386/i386.c (ix86_valid_target_attribute_tree):
Use ggc_strdup to copy option_strings to opts->x_ix86_arch_string and
opts->x_ix86_tune_string.
2015-12-11 Richard Biener <rguenther@suse.de>
* lto-streamer.h (lto_simple_header_with_strings): Remove

View file

@ -6152,7 +6152,7 @@ ix86_valid_target_attribute_tree (tree args,
if (option_strings[IX86_FUNCTION_SPECIFIC_ARCH])
{
opts->x_ix86_arch_string
= option_strings[IX86_FUNCTION_SPECIFIC_ARCH];
= ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_ARCH]);
/* If arch= is set, clear all bits in x_ix86_isa_flags,
except for ISA_64BIT, ABI_64, ABI_X32, and CODE16. */
@ -6166,7 +6166,8 @@ ix86_valid_target_attribute_tree (tree args,
opts->x_ix86_arch_string = NULL;
if (option_strings[IX86_FUNCTION_SPECIFIC_TUNE])
opts->x_ix86_tune_string = option_strings[IX86_FUNCTION_SPECIFIC_TUNE];
opts->x_ix86_tune_string
= ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_TUNE]);
else if (orig_tune_defaulted)
opts->x_ix86_tune_string = NULL;