src/hotspot/share/classfile/classLoaderData.cpp
changeset 49658 8237a91c1cca
parent 49603 6ce4db4460ca
child 49738 a7bc87a63dd8
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Tue Apr 03 10:27:46 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Tue Apr 03 13:15:27 2018 +0200
@@ -201,7 +201,7 @@
   VerifyContainsOopClosure(oop target) : _target(target), _found(false) {}
 
   void do_oop(oop* p) {
-    if (p != NULL && *p == _target) {
+    if (p != NULL && oopDesc::equals(RawAccess<>::oop_load(p), _target)) {
       _found = true;
     }
   }
@@ -380,7 +380,7 @@
 
     // Just return if this dependency is to a class with the same or a parent
     // class_loader.
-    if (from == to || java_lang_ClassLoader::isAncestor(from, to)) {
+    if (oopDesc::equals(from, to) || java_lang_ClassLoader::isAncestor(from, to)) {
       return; // this class loader is in the parent list, no need to add it.
     }
   }