8057910: G1: BOT verification should not pass top
authorbrutisso
Tue, 09 Sep 2014 14:27:10 +0200
changeset 26572 d5e6cac59ba1
parent 26571 5fe42815e865
child 26573 dca8faae7397
8057910: G1: BOT verification should not pass top Reviewed-by: stefank, tschatzl
hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Mon Sep 08 10:41:06 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Tue Sep 09 14:27:10 2014 +0200
@@ -370,8 +370,9 @@
 }
 
 void G1BlockOffsetArray::verify() const {
+  assert(gsp()->bottom() < gsp()->top(), "Only non-empty regions should be verified.");
   size_t start_card = _array->index_for(gsp()->bottom());
-  size_t end_card = _array->index_for(gsp()->top());
+  size_t end_card = _array->index_for(gsp()->top() - 1);
 
   for (size_t current_card = start_card; current_card < end_card; current_card++) {
     u_char entry = _array->offset_array(current_card);