external/boost: Silence -fsanitize=nonnull-attribute

...as reported e.g. during CppunitTest_sw_odfimport:

> /workdir/UnpackedTarball/boost/boost/circular_buffer/debug.hpp:37:17: runtime error: null pointer passed as argument 1, which is declared to never be null
> /usr/include/string.h:62:62: note: nonnull attribute specified here
>     #0 0x2b24bc0e6389 in void boost::cb_details::do_fill_uninitialized_memory<SwFrameFormat*>(SwFrameFormat**, unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/debug.hpp:37:5
>     #1 0x2b24bc0e5b48 in boost::circular_buffer<SwFrameFormat*, std::allocator<SwFrameFormat*> >::allocate(unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:2375:9
>     #2 0x2b24bc0e545a in boost::circular_buffer<SwFrameFormat*, std::allocator<SwFrameFormat*> >::initialize_buffer(unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:2482:18
>     #3 0x2b24bc0cfaa7 in boost::circular_buffer<SwFrameFormat*, std::allocator<SwFrameFormat*> >::circular_buffer(unsigned long, std::allocator<SwFrameFormat*> const&) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:1036:9
>     #4 0x2b24bc068cd7 in AppendAllObjs(SwFrameFormats const*, SwFrame const*) /sw/source/core/layout/frmtool.cxx:1100:44
...

Change-Id: Id96a6127990548ab0ae2e8a02b7bec2d61094c37
This commit is contained in:
Stephan Bergmann 2017-01-08 15:57:23 +01:00
parent 126871b071
commit 50eb12a8e3

View File

@ -1,4 +1,4 @@
Work around -fsanitize=bool
Work around -fsanitize=bool and -fsanitize=nonnull-attribute
--- boost/algorithm/string/find_iterator.hpp
+++ boost/algorithm/string/find_iterator.hpp
@ -11,3 +11,14 @@ Work around -fsanitize=bool
{}
//! Constructor
--- boost/circular_buffer/debug.hpp
+++ boost/circular_buffer/debug.hpp
@@ -34,7 +34,7 @@
template <class T>
inline void do_fill_uninitialized_memory(T* data, std::size_t size_in_bytes) BOOST_NOEXCEPT {
- std::memset(static_cast<void*>(data), UNINITIALIZED, size_in_bytes);
+ if (size_in_bytes != 0) std::memset(static_cast<void*>(data), UNINITIALIZED, size_in_bytes);
}
template <class T>