Browse Source

[2831] corrected assert condition for overflow check

JINMEI Tatuya 12 years ago
parent
commit
059b6a3e1f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/util/memory_segment_mapped.cc

+ 1 - 1
src/lib/util/memory_segment_mapped.cc

@@ -81,7 +81,7 @@ struct MemorySegmentMapped::Impl {
         // behavior.  But we basically assume grow() would fail before this
         // happens, so we assert it shouldn't happen.
         const size_t new_size = prev_size * 2;
-        assert(new_size != 0);
+        assert(new_size > prev_size);
 
         if (!BaseSegment::grow(filename_.c_str(), new_size - prev_size)) {
             throw std::bad_alloc();