* tree.c (make_tree_vec_stat, grow_tree_vec_stat): Use size_t.

From-SVN: r248302
This commit is contained in:
Jason Merrill 2017-05-19 14:55:17 -04:00 committed by Jason Merrill
parent 281161d16b
commit 2944f36d02
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2017-05-19 Jason Merrill <jason@redhat.com>
* tree.c (make_tree_vec_stat, grow_tree_vec_stat): Use size_t.
2017-05-19 Marek Polacek <polacek@redhat.com>
PR sanitizer/80800

View file

@ -2268,7 +2268,7 @@ tree
make_tree_vec_stat (int len MEM_STAT_DECL)
{
tree t;
int length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
size_t length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
record_node_allocation_statistics (TREE_VEC, length);
@ -2290,8 +2290,8 @@ grow_tree_vec_stat (tree v, int len MEM_STAT_DECL)
int oldlen = TREE_VEC_LENGTH (v);
gcc_assert (len > oldlen);
int oldlength = (oldlen - 1) * sizeof (tree) + sizeof (struct tree_vec);
int length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
size_t oldlength = (oldlen - 1) * sizeof (tree) + sizeof (struct tree_vec);
size_t length = (len - 1) * sizeof (tree) + sizeof (struct tree_vec);
record_node_allocation_statistics (TREE_VEC, length - oldlength);