Skip to content

Commit 37d3146

Browse files
committed
8289002: Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null
Reviewed-by: dholmes, aph
1 parent ecfa38f commit 37d3146

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: src/hotspot/share/services/diagnosticFramework.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ void DCmdFactory::send_notification_internal(TRAPS) {
462462
if (notif) {
463463

464464
Klass* k = Management::com_sun_management_internal_DiagnosticCommandImpl_klass(CHECK);
465+
if (k == nullptr) {
466+
fatal("Should have the DiagnosticCommandImpl class");
467+
return; // silence the compiler
468+
}
469+
465470
InstanceKlass* dcmd_mbean_klass = InstanceKlass::cast(k);
466471

467472
JavaValue result(T_OBJECT);

Diff for: src/hotspot/share/services/memoryManager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ instanceOop MemoryManager::get_memory_manager_instance(TRAPS) {
100100
signature = vmSymbols::createMemoryManager_signature();
101101
}
102102

103+
if (k == nullptr) {
104+
fatal("Should have the ManagementFactoryHelper or GarbageCollectorExtImpl class");
105+
return nullptr; // silence the compiler
106+
}
107+
103108
InstanceKlass* ik = InstanceKlass::cast(k);
104109

105110
JavaCalls::call_static(&result,

0 commit comments

Comments
 (0)