< prev index next >

src/hotspot/share/classfile/modules.cpp

Print this page

        

@@ -305,11 +305,11 @@
 
   const char* module_version = get_module_version(version);
 
   oop loader = java_lang_Module::loader(module_handle());
   // Make sure loader is not the jdk.internal.reflect.DelegatingClassLoader.
-  if (loader != java_lang_ClassLoader::non_reflection_class_loader(loader)) {
+  if (!oopDesc::unsafe_equals(loader, java_lang_ClassLoader::non_reflection_class_loader(loader))) {
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Class loader is an invalid delegating class loader");
   }
   Handle h_loader = Handle(THREAD, loader);
   // define_module can be called during start-up, before the class loader's ClassLoaderData
< prev index next >