re PR c/48650 (valgrind: Invalid write of size 8 in build_string (tree.c:1524))

2011-04-18  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48650
	* tree.c (build_string): STRING_CST is now derived from tree_typed.

From-SVN: r172642
This commit is contained in:
Richard Guenther 2011-04-18 11:18:01 +00:00 committed by Richard Biener
parent 7d5fc81417
commit d25a79eae6
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-04-18 Richard Guenther <rguenther@suse.de>
PR middle-end/48650
* tree.c (build_string): STRING_CST is now derived from tree_typed.
2011-04-18 Eric Botcazou <ebotcazou@adacore.com>
PR lto/48492

View File

@ -1521,7 +1521,7 @@ build_string (int len, const char *str)
s = ggc_alloc_tree_node (length);
memset (s, 0, sizeof (struct tree_common));
memset (s, 0, sizeof (struct tree_typed));
TREE_SET_CODE (s, STRING_CST);
TREE_CONSTANT (s) = 1;
TREE_STRING_LENGTH (s) = len;