changeset 46375:1b360c12efc7

8171813: Reported null pointer dereference defect groups Summary: Added required explicit NULL checks Reviewed-by: thartmann, zmajo
author rraghavan
date Sun, 09 Apr 2017 20:52:43 -0700
parents 6896a3ff27a8
children 52f13866d98b
files hotspot/src/share/vm/compiler/compileBroker.cpp hotspot/src/share/vm/opto/library_call.cpp hotspot/src/share/vm/runtime/simpleThresholdPolicy.inline.hpp
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
   }
--- 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);
 
--- 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;
     }
   }