Fix off-by-one storage problem in irange_allocator.

gcc/ChangeLog:

	* value-range.h (irange_allocator::allocate): Increase
	newir storage by one.
This commit is contained in:
Aldy Hernandez 2020-10-06 08:21:56 +02:00
parent 44e20dce59
commit 952adf0218

View file

@ -670,7 +670,7 @@ irange_allocator::allocate (unsigned num_pairs)
struct newir {
irange range;
tree mem[1];
tree mem[2];
};
size_t nbytes = (sizeof (newir) + sizeof (tree) * 2 * (num_pairs - 1));
struct newir *r = (newir *) obstack_alloc (&m_obstack, nbytes);