From: Jeff Law Date: Thu, 16 Apr 1998 16:48:43 +0000 (-0600) Subject: search.c (my_tree_cons): Don't clear words outside the newly allocated node. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=936f0e02314b40197b8a0bf310060cddc4e21e19;p=gcc.git search.c (my_tree_cons): Don't clear words outside the newly allocated node. 8 * search.c (my_tree_cons): Don't clear words outside the newly allocated node. From-SVN: r19238 --- diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 488220adc2a..4438372d79c 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -260,7 +260,10 @@ my_tree_cons (purpose, value, chain) tree p = (tree)obstack_alloc (&type_obstack_entries, sizeof (struct tree_list)); ++my_tree_node_counter; TREE_TYPE (p) = NULL_TREE; - ((HOST_WIDE_INT *)p)[3] = 0; + /* The type of the last on the LHS of this statement must be a pointer + to the same type as the bitfields in struct tree_common. Otherwise + we may write beyond our intended area. */ + ((unsigned *)p)[3] = 0; TREE_SET_CODE (p, TREE_LIST); TREE_PURPOSE (p) = purpose; TREE_VALUE (p) = value;