Boost logo

Boost-Commit :

From: ramey_at_[hidden]
Date: 2008-06-10 00:33:00


Author: ramey
Date: 2008-06-10 00:33:00 EDT (Tue, 10 Jun 2008)
New Revision: 46287
URL: http://svn.boost.org/trac/boost/changeset/46287

Log:
adjust to defeat gcc string content sharing in non conforming code
Text files modified:
   trunk/boost/archive/impl/text_iarchive_impl.ipp | 6 ++++++
   trunk/boost/archive/impl/text_wiarchive_impl.ipp | 3 +++
   2 files changed, 9 insertions(+), 0 deletions(-)

Modified: trunk/boost/archive/impl/text_iarchive_impl.ipp
==============================================================================
--- trunk/boost/archive/impl/text_iarchive_impl.ipp (original)
+++ trunk/boost/archive/impl/text_iarchive_impl.ipp 2008-06-10 00:33:00 EDT (Tue, 10 Jun 2008)
@@ -52,6 +52,9 @@
     #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
     if(NULL != s.data())
     #endif
+ #if __GNUC__ > 3
+ s.clear();
+ #endif
         s.resize(size);
     if(0 < size)
         is.read(&(*s.begin()), size);
@@ -83,6 +86,9 @@
     #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
     if(NULL != ws.data())
     #endif
+ #if __GNUC__ > 3
+ s.clear();
+ #endif
         ws.resize(size);
     // skip separating space
     is.get();

Modified: trunk/boost/archive/impl/text_wiarchive_impl.ipp
==============================================================================
--- trunk/boost/archive/impl/text_wiarchive_impl.ipp (original)
+++ trunk/boost/archive/impl/text_wiarchive_impl.ipp 2008-06-10 00:33:00 EDT (Tue, 10 Jun 2008)
@@ -90,6 +90,9 @@
     #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
     if(NULL != ws.data())
     #endif
+ #if __GNUC__ > 3
+ ws.clear();
+ #endif
         ws.resize(size);
     // note breaking a rule here - is this a problem on some platform
     is.read(const_cast<wchar_t *>(ws.data()), size);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk