From ecbffdd88f3f073ded32f1cd632dfb1bfc5d7c38 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Tue, 5 Nov 2013 13:51:32 +0000 Subject: don't try and free what must be a null vector when reserving 0 elements in va_heap::reserve 2013-11-05 Trevor Saunders * vec.c (vec_prefix::calculate_allocation): Don't try to handle the case of no prefix and reserving zero slots, because when that's the case we'll never get here. * vec.h (va_heap::reserve): Don't try and handle vec_prefix::calculate_allocation returning zero because that should never happen. From-SVN: r204392 --- gcc/vec.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gcc/vec.h') diff --git a/gcc/vec.h b/gcc/vec.h index f97e022..b1ebda4 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -283,11 +283,7 @@ va_heap::reserve (vec *&v, unsigned reserve, bool exact { unsigned alloc = vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact); - if (!alloc) - { - release (v); - return; - } + gcc_assert (alloc); if (GATHER_STATISTICS && v) v->m_vecpfx.release_overhead (); -- cgit v1.1