PR bootstrap/78817 - stage2 bootstrap failure in vec.h:1613:5: error: argument 1 null where non-null expected after r243661

gcc/ChangeLog:
	* vec.h (vec<T, va_heap, vl_ptr>::safe_grow_cleared): Assert
	a pointer is non-null.

From-SVN: r243736
This commit is contained in:
Martin Sebor 2016-12-16 02:57:22 +00:00 committed by Martin Sebor
parent 2ae30b147b
commit 7bd1e2edf9
2 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2016-12-15 Martin Sebor <msebor@redhat.com>
PR bootstrap/78817
* vec.h (vec<T, va_heap, vl_ptr>::safe_grow_cleared): Assert
a pointer is non-null.
2016-12-15 Andrew Senkevich <andrew.senkevich@intel.com>
* config/i386/avx512bwintrin.h: Add new k-mask intrinsics.

View File

@ -1607,10 +1607,16 @@ inline void
vec<T, va_heap, vl_ptr>::safe_grow_cleared (unsigned len MEM_STAT_DECL)
{
unsigned oldlen = length ();
size_t sz = sizeof (T) * (len - oldlen);
safe_grow (len PASS_MEM_STAT);
if (sz != 0)
memset (&(address ()[oldlen]), 0, sz);
gcc_checking_assert (oldlen <= len);
if (size_t sz = sizeof (T) * (len - oldlen))
{
safe_grow (len PASS_MEM_STAT);
T *p = address ();
gcc_assert (p != NULL);
memset (p + oldlen, 0, sz);
}
}