Subject: [Boost-bugs] [Boost C++ Libraries] #6730: error reading archive created by old version when it contains pointer
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-24 06:11:08
#6730: error reading archive created by old version when it contains pointer
------------------------------------------------+---------------------------
Reporter: d s m a l l @⦠| Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.45.0
Severity: Problem | Keywords:
------------------------------------------------+---------------------------
Problem is similar to ticket 4660. Fwiw we just discovered a gap
in our unit tests. :(
Code below contains our local fix. Note that we only have used
lib ver 3 and lib ver 5 and that this is the reason the fix only
targets those versions.
One last word, I checked the latest code ( 1.49 ) and it seems to
contain the same flaw as 1.45.
{{{
void load_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
else
if(boost::archive::library_version_type(3) == lvt ||
boost::archive::library_version_type(5) == lvt ){
#pragma message( "CTMS fix for serialization bug ( lack of backwards
compatability ) introduced by boost 1.45." )
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
else{
int x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6730> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC