From 07dabe012b6e9cddd9fef59551bc3d6f6962bbf7 Mon Sep 17 00:00:00 2001 Subject: Backport-8057910: G1: BOT verification should not pass top --- .../src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp index b908e8faf..b0b891d85 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp @@ -371,8 +371,9 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ } 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); -- 2.22.0