diff -r 4cbfa5077d68 -r 623722a6aeb9 src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp Mon Nov 25 12:32:40 2019 +0100 +++ b/src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.cpp Mon Nov 25 12:33:15 2019 +0100 @@ -146,7 +146,7 @@ while(index < num_regions) { if (is_in(index)) { - jint cur = Atomic::cmpxchg((jint)(index + 1), &_current_index, saved_current); + jint cur = Atomic::cmpxchg(&_current_index, saved_current, (jint)(index + 1)); assert(cur >= (jint)saved_current, "Must move forward"); if (cur == saved_current) { assert(is_in(index), "Invariant");