From e59421db7a5cf557f39e55a47b99fd34b5895d57 Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 15 Dec 2014 14:24:06 +0000 Subject: 2014-12-15 Richard Biener * vec.h (vec::safe_grow): Guard against a grow to zero size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218749 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/vec.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/vec.h') 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); } -- cgit v1.2.1