diff --git a/src/hotspot/share/adlc/output_h.cpp b/src/hotspot/share/adlc/output_h.cpp index cbcc00efa3b9c..38a74ca15fda9 100644 --- a/src/hotspot/share/adlc/output_h.cpp +++ b/src/hotspot/share/adlc/output_h.cpp @@ -1949,6 +1949,7 @@ void ArchDesc::declareClasses(FILE *fp) { fprintf(fp, " };\n"); }*/ else if( instr->is_ideal_copy() && + (instr->_matrule != nullptr && instr->_matrule->_rChild != nullptr) && !strcmp(instr->_matrule->_lChild->_opType,"stackSlotP") ) { // !!!!! // Special hack for ideal Copy of pointer. Bottom type is oop or not depending on input. diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp index b00ab25b8f0b9..038323342f05f 100644 --- a/src/hotspot/share/c1/c1_LinearScan.cpp +++ b/src/hotspot/share/c1/c1_LinearScan.cpp @@ -4418,7 +4418,8 @@ Interval* Interval::split(int split_pos) { } assert(cur != Range::end(), "split interval after end of last range"); - if (cur->from() < split_pos) { + if ((cur != nullptr) && + (cur->from() < split_pos)) { result->_first = new Range(split_pos, cur->to(), cur->next()); cur->set_to(split_pos); cur->set_next(Range::end()); diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp index 4c44c43772d0a..36f3eb037f96b 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp @@ -470,7 +470,7 @@ void JfrThreadSampler::set_period(bool is_java_period, int64_t period_millis) { void JfrThreadSampler::set_java_sample_period(int64_t period_millis) { assert(period_millis >= 0, "invariant"); - if (_instance == nullptr && 0 == period_millis) { + if (_instance == nullptr || 0 == period_millis) { return; } instance().set_period(true, period_millis); @@ -478,7 +478,7 @@ void JfrThreadSampler::set_java_sample_period(int64_t period_millis) { void JfrThreadSampler::set_native_sample_period(int64_t period_millis) { assert(period_millis >= 0, "invariant"); - if (_instance == nullptr && 0 == period_millis) { + if (_instance == nullptr || 0 == period_millis) { return; } instance().set_period(false, period_millis); diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index 23473940178c6..3c1c1daaf6bb6 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -61,6 +61,7 @@ JVMCICompileState::JVMCICompileState(CompileTask* task, JVMCICompiler* compiler) _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables() ? 1 : 0; _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions() ? 1 : 0; _jvmti_can_pop_frame = JvmtiExport::can_pop_frame() ? 1 : 0; + assert(_task != nullptr, "The task cannot be null"); _target_method_is_old = _task != nullptr && _task->method()->is_old(); if (task->is_blocking()) { task->set_blocking_jvmci_compile_state(this); diff --git a/src/hotspot/share/nmt/mallocSiteTable.cpp b/src/hotspot/share/nmt/mallocSiteTable.cpp index 55fa5f0b173ed..800791949af28 100644 --- a/src/hotspot/share/nmt/mallocSiteTable.cpp +++ b/src/hotspot/share/nmt/mallocSiteTable.cpp @@ -168,8 +168,9 @@ MallocSite* MallocSiteTable::malloc_site(uint32_t marker) { MallocSiteHashtableEntry* head = _table[bucket_idx]; for (size_t index = 0; index < pos_idx && head != nullptr; - index++, head = (MallocSiteHashtableEntry*)head->next()) {} - assert(head != nullptr, "Invalid position index"); + index++, head = ((MallocSiteHashtableEntry*)head->next() == nullptr) ? head : + (MallocSiteHashtableEntry*)head->next()) {} + return head->data(); } diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp index 10430a09e7231..6443a3355d6a7 100644 --- a/src/hotspot/share/opto/vectorIntrinsics.cpp +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp @@ -1313,7 +1313,7 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { const TypeAryPtr* arr_type = addr_type->isa_aryptr(); // The array must be consistent with vector type - if (arr_type == nullptr || (arr_type != nullptr && !elem_consistent_with_arr(elem_bt, arr_type, false))) { + if (arr_type != nullptr && !elem_consistent_with_arr(elem_bt, arr_type, false)) { log_if_needed(" ** not supported: arity=%d op=%s vlen=%d etype=%s atype=%s ismask=no", is_scatter, is_scatter ? "scatter" : "gather", num_elem, type2name(elem_bt), type2name(arr_type->elem()->array_element_basic_type())); diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index a928b0443eef4..a93b6c8a8b5d5 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -1047,7 +1047,8 @@ freeze_result FreezeBase::finalize_freeze(const frame& callee, frame& caller, in assert(!allocated_old_in_freeze_fast || (!UseZGC && !UseG1GC), "Unexpected allocation"); DEBUG_ONLY(bool empty_chunk = true); - if (unextended_sp < _freeze_size || chunk->is_gc_mode() || (!allocated_old_in_freeze_fast && chunk->requires_barriers())) { + if (unextended_sp < _freeze_size || (chunk != nullptr && + (chunk->is_gc_mode() || (!allocated_old_in_freeze_fast && chunk->requires_barriers())))) { // ALLOCATE NEW CHUNK if (lt.develop_is_enabled()) {