--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegionSet.cpp Mon Nov 25 12:33:15 2019 +0100
@@ -97,7 +97,7 @@
while(index < num_regions) {
if (_set->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(_set->is_in(index), "Invariant");