summaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-05 13:51:32 +0000
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-05 13:51:32 +0000
commitcce95bcb3f3aa03d4dd82208732d0cb453637ea8 (patch)
tree57b2f9ccac9f133f2af4e7f3a1e02c3ad7587f55 /gcc/vec.h
parent435749aa288448f60c87cb0eb8442951158bddcf (diff)
downloadgcc-cce95bcb3f3aa03d4dd82208732d0cb453637ea8.tar.gz
don't try and free what must be a null vector when reserving 0 elements
in va_heap::reserve 2013-11-05 Trevor Saunders <tsaunders@mozilla.com> * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204392 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vec.h')
-rw-r--r--gcc/vec.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/vec.h b/gcc/vec.h
index f97e022f24a..b1ebda44f5e 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -283,11 +283,7 @@ va_heap::reserve (vec<T, va_heap, vl_embed> *&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 ();