mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8140665: SIGSEGV when a primitive type's class is used as the host class in a call to DefineAnonymousClass call
Instead of assertng, throw an exception Reviewed-by: acorn, coleenp
This commit is contained in:
parent
49d6460189
commit
ff8f7e4a2b
2 changed files with 103 additions and 1 deletions
|
@ -905,7 +905,10 @@ Unsafe_DefineAnonymousClass_impl(JNIEnv *env,
|
|||
}
|
||||
|
||||
const Klass* host_klass = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(host_class));
|
||||
assert(host_klass != NULL, "invariant");
|
||||
// Primitive types have NULL Klass* fields in their java.lang.Class instances.
|
||||
if (host_klass == NULL) {
|
||||
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
|
||||
}
|
||||
|
||||
const char* host_source = host_klass->external_name();
|
||||
Handle host_loader(THREAD, host_klass->class_loader());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue