Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83341 - in branches/release: . boost boost/smart_ptr boost/smart_ptr/detail
From: pdimov_at_[hidden]
Date: 2013-03-07 03:18:49


Author: pdimov
Date: 2013-03-07 03:18:48 EST (Thu, 07 Mar 2013)
New Revision: 83341
URL: http://svn.boost.org/trac/boost/changeset/83341

Log:
Merged revision(s) 83198 from trunk: Avoid stack overflow in make_shared. Fixes #4256. Fixes #7965.
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/smart_ptr/ (props changed)
Text files modified:
   branches/release/boost/smart_ptr/detail/shared_count.hpp | 8 ++++----
   branches/release/boost/smart_ptr/make_shared_object.hpp | 4 ++++
   2 files changed, 8 insertions(+), 4 deletions(-)

Modified: branches/release/boost/smart_ptr/detail/shared_count.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/shared_count.hpp (original)
+++ branches/release/boost/smart_ptr/detail/shared_count.hpp 2013-03-07 03:18:48 EST (Thu, 07 Mar 2013)
@@ -200,7 +200,7 @@
         }
         catch( ... )
         {
- D()( p ); // delete p
+ D::operator_fn( p ); // delete p
             throw;
         }
 
@@ -210,7 +210,7 @@
 
         if( pi_ == 0 )
         {
- D()( p ); // delete p
+ D::operator_fn( p ); // delete p
             boost::throw_exception( std::bad_alloc() );
         }
 
@@ -286,7 +286,7 @@
         }
         catch(...)
         {
- D()( p );
+ D::operator_fn( p );
 
             if( pi_ != 0 )
             {
@@ -306,7 +306,7 @@
         }
         else
         {
- D()( p );
+ D::operator_fn( p );
             boost::throw_exception( std::bad_alloc() );
         }
 

Modified: branches/release/boost/smart_ptr/make_shared_object.hpp
==============================================================================
--- branches/release/boost/smart_ptr/make_shared_object.hpp (original)
+++ branches/release/boost/smart_ptr/make_shared_object.hpp 2013-03-07 03:18:48 EST (Thu, 07 Mar 2013)
@@ -87,6 +87,10 @@
         destroy();
     }
 
+ static void operator_fn( T* ) // operator() can't be static
+ {
+ }
+
     void * address() BOOST_NOEXCEPT
     {
         return storage_.data_;


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