From: Aldy Hernandez Date: Tue, 6 Oct 2020 06:21:56 +0000 (+0200) Subject: Fix off-by-one storage problem in irange_allocator. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=952adf021889b5e055085d0ed63942ff97d913de;p=gcc.git Fix off-by-one storage problem in irange_allocator. gcc/ChangeLog: * value-range.h (irange_allocator::allocate): Increase newir storage by one. --- diff --git a/gcc/value-range.h b/gcc/value-range.h index 94b48e55e77..7031a823138 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);