From 87685cc870bb71211d576ce4b33003e2b4b77067 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sat, 3 Sep 2005 04:45:27 +0000 Subject: [PATCH] correction to reset_object_address [SVN r30788] --- src/basic_iarchive.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/basic_iarchive.cpp b/src/basic_iarchive.cpp index de69459a..59198104 100644 --- a/src/basic_iarchive.cpp +++ b/src/basic_iarchive.cpp @@ -256,8 +256,13 @@ basic_iarchive_impl::reset_object_address( const void * new_address, const void *old_address ){ - object_id_type i = moveable_objects_recent; - while(i < moveable_objects_end){ + object_id_type i; + for(i = moveable_objects_recent; i < moveable_objects_end; ++i){ + if(old_address == object_id_vector[i].address) + break; + } + for(i = moveable_objects_recent; i < moveable_objects_end; ++i){ + // calculate displacement from this level // warning - pointer arithmetic on void * is in herently non-portable // but expected to work on all platforms in current usage @@ -380,7 +385,7 @@ basic_iarchive_impl::load_object( load_preamble(ar, co); // save the current move stack position in case we want to truncate it - boost::state_saver w(moveable_objects_start); + boost::state_saver w(moveable_objects_start); // note: extra line used to evade borland issue const bool tracking = co.tracking_level;