8155977: ObjectInputStream::resolveClass & resolveProxyClass for platform loader

Reviewed-by: acorn, alanb, chegar, dfuchs
This commit is contained in:
Mandy Chung 2016-05-12 11:16:16 -07:00
parent 8eed1ef6af
commit 2bbe02b202

View File

@ -3387,14 +3387,14 @@ bool force_verify_field_access(Klass* current_class, Klass* field_class, AccessF
return (!access.is_private() && InstanceKlass::cast(current_class)->is_same_class_package(field_class));
}
// Return the first non-null class loader up the execution stack, or null
// if only code from the null class loader is on the stack.
// Return the first user-defined class loader up the execution stack, or null
// if only code from the bootstrap or platform class loader is on the stack.
JVM_ENTRY(jobject, JVM_LatestUserDefinedLoader(JNIEnv *env))
for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
vfst.skip_reflection_related_frames(); // Only needed for 1.4 reflection
oop loader = vfst.method()->method_holder()->class_loader();
if (loader != NULL) {
if (loader != NULL && !SystemDictionary::is_platform_class_loader(loader)) {
return JNIHandles::make_local(env, loader);
}
}