8222180: ZGC: ZForwarding::verify() failing when checking for duplicates
Reviewed-by: pliden, eosterlund
--- a/src/hotspot/share/gc/z/zForwarding.cpp Wed Apr 10 12:05:50 2019 +0200
+++ b/src/hotspot/share/gc/z/zForwarding.cpp Tue Apr 09 12:47:34 2019 +0200
@@ -69,6 +69,11 @@
// Check for duplicates
for (ZForwardingCursor j = i + 1; j < _entries.length(); j++) {
const ZForwardingEntry other = at(&j);
+ if (!other.populated()) {
+ // Skip empty entries
+ continue;
+ }
+
guarantee(entry.from_index() != other.from_index(), "Duplicate from");
guarantee(entry.to_offset() != other.to_offset(), "Duplicate to");
}