Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56467 - trunk/boost/test/impl
From: gennadiy.rozental_at_[hidden]
Date: 2009-09-28 21:33:37


Author: rogeeff
Date: 2009-09-28 21:33:36 EDT (Mon, 28 Sep 2009)
New Revision: 56467
URL: http://svn.boost.org/trac/boost/changeset/56467

Log:
apparently compiler might want to examine tu.second twice: before and after calling destructor
Fixes #2889
Fixes #3432
Fixes #2647
Text files modified:
   trunk/boost/test/impl/framework.ipp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Modified: trunk/boost/test/impl/framework.ipp
==============================================================================
--- trunk/boost/test/impl/framework.ipp (original)
+++ trunk/boost/test/impl/framework.ipp 2009-09-28 21:33:36 EDT (Mon, 28 Sep 2009)
@@ -124,13 +124,14 @@
     void clear()
     {
         while( !m_test_units.empty() ) {
- test_unit_store::value_type const& tu = *m_test_units.begin();
+ test_unit_store::value_type const& tu = *m_test_units.begin();
+ test_unit* tu_ptr = tu.second;
 
             // the delete will erase this element from map
- if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite )
- delete static_cast<test_suite const*>(tu.second);
+ if( test_id_2_unit_type( tu.second->p_id ) == tut_suite )
+ delete (test_suite const*)tu_ptr;
             else
- delete static_cast<test_case const*>(tu.second);
+ delete (test_case const*)tu_ptr;
         }
     }
 


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