diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 14:24:06 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 14:24:06 +0000 |
commit | e59421db7a5cf557f39e55a47b99fd34b5895d57 (patch) | |
tree | 372fd7198a3addca864a82b66c96926244e5e089 /gcc/vec.h | |
parent | abe4e033b97b05eec35afe34f5955975fa7e9ef6 (diff) | |
download | gcc-e59421db7a5cf557f39e55a47b99fd34b5895d57.tar.gz |
2014-12-15 Richard Biener <rguenther@suse.de>
* 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
Diffstat (limited to 'gcc/vec.h')
-rw-r--r-- | gcc/vec.h | 5 |
1 files changed, 4 insertions, 1 deletions
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<T, va_heap, vl_ptr>::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); } |