Skip to content

Commit

Permalink
Move assert on klass is InstanceKlass after its NULL check. Added san…
Browse files Browse the repository at this point in the history
…ity check on class_list_file is not NULL before check on it is open.
  • Loading branch information
Yumin Qi authored and Yumin Qi committed Oct 7, 2020
1 parent f5584dc commit 107192f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/lambdaFormInvokers.cpp
Expand Up @@ -126,11 +126,11 @@ void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) {
Symbol* class_name = SymbolTable::new_symbol((const char*)name);
// the class must exist
Klass* klass = SystemDictionary::resolve_or_null(class_name, THREAD);
assert(klass->is_instance_klass(), "Should be");
if (klass == NULL) {
log_info(cds)("Class %s not present, skip", name);
return;
}
assert(klass->is_instance_klass(), "Should be");

ClassLoaderData* cld = ClassLoaderData::the_null_class_loader_data();
Handle protection_domain;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/jvm.cpp
Expand Up @@ -3869,7 +3869,7 @@ JVM_END

JVM_ENTRY(jboolean, JVM_IsDumpingClassList(JNIEnv *env))
JVMWrapper("JVM_IsDumpingClassList");
return DumpLoadedClassList != NULL && classlist_file->is_open();
return DumpLoadedClassList != NULL && classlist_file != NULL && classlist_file->is_open();
JVM_END

JVM_ENTRY(void, JVM_LogLambdaFormInvoker(JNIEnv *env, jstring line))
Expand Down

0 comments on commit 107192f

Please sign in to comment.