# HG changeset patch # User rraghavan # Date 1491796363 25200 # Node ID 1b360c12efc70363375a908e9e1750af0bdca59f # Parent 6896a3ff27a86cbe0a5aabc41d146f74428f4872 8171813: Reported null pointer dereference defect groups Summary: Added required explicit NULL checks Reviewed-by: thartmann, zmajo diff -r 6896a3ff27a8 -r 1b360c12efc7 hotspot/src/share/vm/compiler/compileBroker.cpp --- a/hotspot/src/share/vm/compiler/compileBroker.cpp Thu Apr 06 23:46:38 2017 +0000 +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Sun Apr 09 20:52:43 2017 -0700 @@ -1052,8 +1052,8 @@ // lock, make sure that the compilation // isn't prohibited in a straightforward way. - AbstractCompiler *comp = CompileBroker::compiler(comp_level); - if (!comp->can_compile_method(method) || + AbstractCompiler* comp = CompileBroker::compiler(comp_level); + if (comp == NULL || !comp->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level, directive->ExcludeOption)) { return NULL; } diff -r 6896a3ff27a8 -r 1b360c12efc7 hotspot/src/share/vm/opto/library_call.cpp --- a/hotspot/src/share/vm/opto/library_call.cpp Thu Apr 06 23:46:38 2017 +0000 +++ b/hotspot/src/share/vm/opto/library_call.cpp Sun Apr 09 20:52:43 2017 -0700 @@ -347,7 +347,7 @@ // methods access VM-internal data. VM_ENTRY_MARK; methodHandle mh(THREAD, m->get_Method()); - is_available = compiler->is_intrinsic_supported(mh, is_virtual) && + is_available = compiler != NULL && compiler->is_intrinsic_supported(mh, is_virtual) && !C->directive()->is_intrinsic_disabled(mh) && !vmIntrinsics::is_disabled_by_flags(mh); diff -r 6896a3ff27a8 -r 1b360c12efc7 hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp --- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp Thu Apr 06 23:46:38 2017 +0000 +++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp Sun Apr 09 20:52:43 2017 -0700 @@ -77,8 +77,8 @@ } #if INCLUDE_JVMCI if (UseJVMCICompiler) { - if (TieredCompilation && CompileBroker::compiler(CompLevel_full_optimization) != NULL && - CompileBroker::compiler(CompLevel_full_optimization)->is_trivial(method)) { + AbstractCompiler* comp = CompileBroker::compiler(CompLevel_full_optimization); + if (TieredCompilation && comp != NULL && comp->is_trivial(method)) { return true; } }