Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84485 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2013-05-25 07:46:21


Author: chris_kohlhoff
Date: 2013-05-25 07:46:20 EDT (Sat, 25 May 2013)
New Revision: 84485
URL: http://svn.boost.org/trac/boost/changeset/84485

Log:
Add assertions that num_buckets_ is non-zero. Refs #7739
Text files modified:
   trunk/boost/asio/detail/hash_map.hpp | 2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)

Modified: trunk/boost/asio/detail/hash_map.hpp
==============================================================================
--- trunk/boost/asio/detail/hash_map.hpp (original)
+++ trunk/boost/asio/detail/hash_map.hpp 2013-05-25 07:46:20 EDT (Sat, 25 May 2013)
@@ -181,6 +181,7 @@
   void erase(iterator it)
   {
     BOOST_ASIO_ASSERT(it != values_.end());
+ BOOST_ASIO_ASSERT(num_buckets_ != 0);
 
     size_t bucket = calculate_hash_value(it->first) % num_buckets_;
     bool is_first = (it == buckets_[bucket].first);
@@ -244,6 +245,7 @@
     if (num_buckets == num_buckets_)
       return;
     num_buckets_ = num_buckets;
+ BOOST_ASIO_ASSERT(num_buckets_ != 0);
 
     iterator end_iter = values_.end();
 


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