Skip to content

Commit 01c26ba

Browse files
authored
Merge pull request #292 from cmazakas/ubsan-fixes-v2
ubsan fixes v2
2 parents 404e0a3 + 6388138 commit 01c26ba

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

include/boost/archive/detail/interface_oarchive.hpp

-7
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ class interface_oarchive
4444
typedef mpl::bool_<true> is_saving;
4545

4646
// return a pointer to the most derived class
47-
#if BOOST_WORKAROUND(BOOST_GCC_VERSION,>=40900)||\
48-
BOOST_WORKAROUND(BOOST_CLANG,>=1)&&\
49-
(__clang_major__>3 || __clang_major__==3 && __clang_minor__ >= 8)
50-
/* https://github.com/boostorg/poly_collection/issues/15 */
51-
52-
__attribute__((no_sanitize("undefined")))
53-
#endif
5447
Archive * This(){
5548
return static_cast<Archive*>(this);
5649
}

include/boost/archive/impl/xml_oarchive_impl.ipp

+3-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ BOOST_ARCHIVE_DECL
131131
xml_oarchive_impl<Archive>::~xml_oarchive_impl(){
132132
if(boost::core::uncaught_exceptions() > 0)
133133
return;
134-
if(0 == (this->get_flags() & no_header))
135-
this->windup();
134+
if(0 == (this->get_flags() & no_header)){
135+
this->put("</boost_serialization>\n");
136+
}
136137
}
137138

138139
} // namespace archive

include/boost/serialization/extended_type_info_no_rtti.hpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,9 @@ class extended_type_info_no_rtti :
100100
}
101101
};
102102
public:
103-
#if BOOST_WORKAROUND(BOOST_GCC_VERSION,>=40900)||\
104-
BOOST_WORKAROUND(BOOST_CLANG,>=1)&&\
105-
(__clang_major__>3 || __clang_major__==3 && __clang_minor__ >= 8)
106-
__attribute__((no_sanitize("undefined")))
107-
#endif
108103
extended_type_info_no_rtti() :
109-
no_rtti_system::extended_type_info_no_rtti_0(get_key())
104+
no_rtti_system::extended_type_info_no_rtti_0(
105+
action<guid_defined< T >::value >::invoke())
110106
{
111107
key_register();
112108
}

0 commit comments

Comments
 (0)