PR libstdc++/66354
* include/bits/stl_algobase.h (__fill_a): Check length before calling
memset.
From-SVN: r223906
+2015-05-31 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/66354
+ * include/bits/stl_algobase.h (__fill_a): Check length before calling
+ memset.
+
2015-05-30 Jonathan Wakely <jwakely@redhat.com>
* include/bits/stl_algobase.h (__equal<true>::equal): Check length
__fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
{
const _Tp __tmp = __c;
- __builtin_memset(__first, static_cast<unsigned char>(__tmp),
- __last - __first);
+ if (const size_t __len = __last - __first)
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
}
/**