src/hotspot/share/oops/constantPool.cpp
changeset 59252 623722a6aeb9
parent 59247 56bf71d64d51
child 59292 95b1385dd476
--- a/src/hotspot/share/oops/constantPool.cpp	Mon Nov 25 12:32:40 2019 +0100
+++ b/src/hotspot/share/oops/constantPool.cpp	Mon Nov 25 12:33:15 2019 +0100
@@ -808,8 +808,9 @@
     // This doesn't deterministically get an error.   So why do we save this?
     // We save this because jvmti can add classes to the bootclass path after
     // this error, so it needs to get the same error if the error is first.
-    jbyte old_tag = Atomic::cmpxchg((jbyte)error_tag,
-                            (jbyte*)this_cp->tag_addr_at(which), (jbyte)tag.value());
+    jbyte old_tag = Atomic::cmpxchg((jbyte*)this_cp->tag_addr_at(which),
+                                    (jbyte)tag.value(),
+                                    (jbyte)error_tag);
     if (old_tag != error_tag && old_tag != tag.value()) {
       // MethodHandles and MethodType doesn't change to resolved version.
       assert(this_cp->tag_at(which).is_klass(), "Wrong tag value");