From c181c50f5a5742a857aa60bb6fbee725ae5aa2b6 Mon Sep 17 00:00:00 2001 From: shshahma Date: Tue, 26 Apr 2016 23:29:51 +0530 Subject: [PATCH] 8147026: Convert an assert in ClassLoaderData to a guarantee Summary: Guarantee is to ensure classloader is a valid oop will help catch the errors at an early stage rather than crashing the JVM later on in the GC Reviewed-by: coleenp --- src/share/vm/classfile/classLoaderData.inline.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share/vm/classfile/classLoaderData.inline.hpp b/src/share/vm/classfile/classLoaderData.inline.hpp index 11014f25c..755ac54a9 100644 --- a/src/share/vm/classfile/classLoaderData.inline.hpp +++ b/src/share/vm/classfile/classLoaderData.inline.hpp @@ -40,7 +40,7 @@ inline ClassLoaderData* ClassLoaderData::class_loader_data(oop loader) { inline ClassLoaderData *ClassLoaderDataGraph::find_or_create(Handle loader, TRAPS) { - assert(loader() != NULL,"Must be a class loader"); + guarantee(loader() != NULL && loader()->is_oop(), "Loader must be oop"); // Gets the class loader data out of the java/lang/ClassLoader object, if non-null // it's already in the loader_data, so no need to add ClassLoaderData* loader_data= java_lang_ClassLoader::loader_data(loader()); -- GitLab