From 952adf021889b5e055085d0ed63942ff97d913de Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 6 Oct 2020 08:21:56 +0200 Subject: [PATCH] Fix off-by-one storage problem in irange_allocator. gcc/ChangeLog: * value-range.h (irange_allocator::allocate): Increase newir storage by one. --- gcc/value-range.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index 94b48e5..7031a82 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -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); -- 2.7.4