diff options
author | Jeff Law <law@gcc.gnu.org> | 1998-04-16 10:48:43 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-04-16 10:48:43 -0600 |
commit | 936f0e02314b40197b8a0bf310060cddc4e21e19 (patch) | |
tree | 18034b1c54c7d5fa4e0067bac51afb95d18a7d0b /gcc | |
parent | 472295b89135af24cd0bc7395950f60c59c25571 (diff) | |
download | gcc-936f0e02314b40197b8a0bf310060cddc4e21e19.zip gcc-936f0e02314b40197b8a0bf310060cddc4e21e19.tar.gz gcc-936f0e02314b40197b8a0bf310060cddc4e21e19.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/search.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |