From a46876c214ff10e1d11d1bd28727bc16765cf3f8 Mon Sep 17 00:00:00 2001 From: law Date: Thu, 16 Apr 1998 16:48:43 +0000 Subject: [PATCH] 8 * search.c (my_tree_cons): Don't clear words outside the newly allocated node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19238 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/search.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 488220a..4438372 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; -- 2.7.4