diff --git a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp index 53de081cc254eb96675c4f5a4e840d5418074a37..2815992429816cc023c1d26fc3e2bce0454252bc 100644 --- a/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp +++ b/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp @@ -208,12 +208,13 @@ apply_closure_to_completed_buffer_helper(int worker_i, nd->index, _sz, true, worker_i); void** buf = nd->buf; + size_t index = nd->index; delete nd; if (b) { deallocate_buffer(buf); return true; // In normal case, go on to next buffer. } else { - enqueue_complete_buffer(buf, nd->index, true); + enqueue_complete_buffer(buf, index, true); return false; } } else {