Fix GitHub #90 ("UBSAN failures detected in preflight CI PR")

This commit is contained in:
Ion Gaztañaga
2018-11-13 22:19:30 +01:00
parent d99bbe1dcc
commit be2ff22a82
3 changed files with 13 additions and 6 deletions

View File

@@ -1261,6 +1261,8 @@ use [*Boost.Container]? There are several reasons for that:
* [@https://github.com/boostorg/container/pull/84 GitHub #84: ['"Allow vector to be assigned to itself"]]. * [@https://github.com/boostorg/container/pull/84 GitHub #84: ['"Allow vector to be assigned to itself"]].
* [@https://github.com/boostorg/container/pull/85 GitHub #85: ['"container: misc-typos"]]. * [@https://github.com/boostorg/container/pull/85 GitHub #85: ['"container: misc-typos"]].
* [@https://github.com/boostorg/container/pull/86 GitHub #86: ['"Add missing warning re-enabling include"]]. * [@https://github.com/boostorg/container/pull/86 GitHub #86: ['"Add missing warning re-enabling include"]].
* [@https://github.com/boostorg/container/issues/90 GitHub #90: ['"UBSAN failures detected in preflight CI PR "]].
[endsect] [endsect]

View File

@@ -171,12 +171,17 @@ class basic_multiallocation_chain
std::pair<void_pointer, void_pointer> extract_data() std::pair<void_pointer, void_pointer> extract_data()
{ {
if(BOOST_LIKELY(!slist_impl_.empty())){
std::pair<void_pointer, void_pointer> ret std::pair<void_pointer, void_pointer> ret
(slist_impl_.begin().operator->() (slist_impl_.begin().operator->()
,slist_impl_.last().operator->()); ,slist_impl_.last().operator->());
slist_impl_.clear(); slist_impl_.clear();
return ret; return ret;
} }
else {
return std::pair<void_pointer, void_pointer>();
}
}
}; };
template<class T> template<class T>

View File

@@ -172,7 +172,7 @@ class resource_adaptor
{} {}
explicit resource_adaptor(BOOST_RV_REF(Allocator) a2) explicit resource_adaptor(BOOST_RV_REF(Allocator) a2)
: base_t(BOOST_MOVE_BASE(base_t, a2)) : base_t(::boost::move(a2))
{} {}
resource_adaptor& operator=(BOOST_COPY_ASSIGN_REF(resource_adaptor) other) resource_adaptor& operator=(BOOST_COPY_ASSIGN_REF(resource_adaptor) other)