< prev index next >

src/share/vm/utilities/bitMap.inline.hpp

Print this page
rev 8928 : 8211926: Catastrophic size_t underflow in BitMap::*_large methods
Reviewed-by: kbarrett, stuefe

@@ -319,14 +319,16 @@
   }
   return mask;
 }
 
 inline void BitMap::set_large_range_of_words(idx_t beg, idx_t end) {
+  assert(beg <= end, "underflow");
   memset(_map + beg, ~(unsigned char)0, (end - beg) * sizeof(uintptr_t));
 }
 
 inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
+  assert(beg <= end, "underflow");
   memset(_map + beg, 0, (end - beg) * sizeof(uintptr_t));
 }
 
 inline BitMap::idx_t BitMap::word_index_round_up(idx_t bit) const {
   idx_t bit_rounded_up = bit + (BitsPerWord - 1);
< prev index next >