From 14475e47b616fb43da20fc2a45850de4dbf6c7d0 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 7 Nov 2019 07:02:55 +0100 Subject: [PATCH] 8233491: Crash in AdapterHandlerLibrary::get_adapter with CDS due to code cache exhaustion Added null check. Reviewed-by: kvn, iklam --- src/hotspot/share/runtime/sharedRuntime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 735878a86b5..3f7e7e44f20 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -2615,7 +2615,7 @@ AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* finger 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) {