mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8152949: Jigsaw crash when Klass in _fixup_module_field_list is unloaded
During start up anonymous classes must be kept alive until after their mirror's module field is patched with java.base Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com> Reviewed-by: coleenp, hseigel
This commit is contained in:
parent
4adb7c0788
commit
48892f6f68
6 changed files with 31 additions and 6 deletions
|
@ -934,7 +934,7 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass0(JNIEnv *env, jobject unsafe, j
|
|||
// this point. The mirror and any instances of this class have to keep
|
||||
// it alive afterwards.
|
||||
if (anon_klass() != NULL) {
|
||||
anon_klass->class_loader_data()->set_keep_alive(false);
|
||||
anon_klass->class_loader_data()->dec_keep_alive();
|
||||
}
|
||||
|
||||
// let caller initialize it as needed...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue