8289002: Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null

Reviewed-by: dholmes, aph
This commit is contained in:
Aleksey Shipilev 2022-08-10 13:26:56 +00:00
parent ecfa38ffa8
commit 37d3146cca
2 changed files with 10 additions and 0 deletions

View File

@ -462,6 +462,11 @@ void DCmdFactory::send_notification_internal(TRAPS) {
if (notif) {
Klass* k = Management::com_sun_management_internal_DiagnosticCommandImpl_klass(CHECK);
if (k == nullptr) {
fatal("Should have the DiagnosticCommandImpl class");
return; // silence the compiler
}
InstanceKlass* dcmd_mbean_klass = InstanceKlass::cast(k);
JavaValue result(T_OBJECT);

View File

@ -100,6 +100,11 @@ instanceOop MemoryManager::get_memory_manager_instance(TRAPS) {
signature = vmSymbols::createMemoryManager_signature();
}
if (k == nullptr) {
fatal("Should have the ManagementFactoryHelper or GarbageCollectorExtImpl class");
return nullptr; // silence the compiler
}
InstanceKlass* ik = InstanceKlass::cast(k);
JavaCalls::call_static(&result,