8233491: Crash in AdapterHandlerLibrary::get_adapter with CDS due to code cache exhaustion
authorthartmann
Thu, 07 Nov 2019 07:02:55 +0100
changeset 58957 00244fd3169a
parent 58956 9a0a5e70eeb2
child 58958 7bfe7df764a2
8233491: Crash in AdapterHandlerLibrary::get_adapter with CDS due to code cache exhaustion Summary: Added null check. Reviewed-by: kvn, iklam
src/hotspot/share/runtime/sharedRuntime.cpp
--- a/src/hotspot/share/runtime/sharedRuntime.cpp	Wed Nov 06 21:18:42 2019 -0500
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp	Thu Nov 07 07:02:55 2019 +0100
@@ -2615,7 +2615,7 @@
 
 AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(const methodHandle& method) {
   AdapterHandlerEntry* entry = get_adapter0(method);
-  if (method->is_shared()) {
+  if (entry != NULL && method->is_shared()) {
     // See comments around Method::link_method()
     MutexLocker mu(AdapterHandlerLibrary_lock);
     if (method->adapter() == NULL) {