src/hotspot/share/gc/shared/referenceProcessor.cpp
changeset 59252 623722a6aeb9
parent 59053 ba6c248cae19
--- a/src/hotspot/share/gc/shared/referenceProcessor.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -1031,7 +1031,7 @@
   // The last ref must have its discovered field pointing to itself.
   oop next_discovered = (current_head != NULL) ? current_head : obj;
 
-  oop retest = HeapAccess<AS_NO_KEEPALIVE>::oop_atomic_cmpxchg(next_discovered, discovered_addr, oop(NULL));
+  oop retest = HeapAccess<AS_NO_KEEPALIVE>::oop_atomic_cmpxchg(discovered_addr, oop(NULL), next_discovered);
 
   if (retest == NULL) {
     // This thread just won the right to enqueue the object.