From: Richard Biener Date: Mon, 15 Dec 2014 14:24:06 +0000 (+0000) Subject: vec.h (vec::safe_grow): Guard against a grow to zero size. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27a7de71c70787a522bd0706dbcbe95311bde552;p=gcc.git vec.h (vec::safe_grow): Guard against a grow to zero size. 2014-12-15 Richard Biener * vec.h (vec::safe_grow): Guard against a grow to zero size. From-SVN: r218749 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e3eda67b24..90075639ab8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-15 Richard Biener + + * vec.h (vec::safe_grow): Guard against a grow to zero size. + 2014-12-15 Richard Biener PR middle-end/64295 diff --git a/gcc/vec.h b/gcc/vec.h index 2e5313dd146..ca568accdcf 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -1574,7 +1574,10 @@ vec::safe_grow (unsigned len MEM_STAT_DECL) unsigned oldlen = length (); gcc_checking_assert (oldlen <= len); reserve_exact (len - oldlen PASS_MEM_STAT); - m_vec->quick_grow (len); + if (m_vec) + m_vec->quick_grow (len); + else + gcc_checking_assert (len == 0); }