< prev index next >

src/hotspot/share/gc/shared/satbMarkQueue.hpp

Print this page
@@ -184,14 +184,14 @@
    void** dst = buf + queue.current_capacity();
    assert(src <= dst, "invariant");
    for ( ; src < dst; ++src) {
      // Search low to high for an entry to keep.
      void* entry = *src;
-     if (!filter_out(entry)) {
+     if (entry != nullptr && !filter_out(entry)) {
        // Found keeper.  Search high to low for an entry to discard.
        while (src < --dst) {
-         if (filter_out(*dst)) {
+         if (*dst == nullptr || filter_out(*dst)) {
            *dst = entry;         // Replace discard with keeper.
            break;
          }
        }
        // If discard search failed (src == dst), the outer loop will also end.
< prev index next >