8191854: Null pointer dereference in methodData.hpp:462
authordlong
Fri, 22 Dec 2017 22:06:54 -0800
changeset 48418 2207e2917a68
parent 48417 044979e94c4e
child 48419 8441a7cea1c1
8191854: Null pointer dereference in methodData.hpp:462 Reviewed-by: kvn
src/hotspot/share/runtime/compilationPolicy.cpp
--- a/src/hotspot/share/runtime/compilationPolicy.cpp	Fri Dec 22 22:01:53 2017 -0800
+++ b/src/hotspot/share/runtime/compilationPolicy.cpp	Fri Dec 22 22:06:54 2017 -0800
@@ -470,8 +470,12 @@
       if (bci != InvocationEntryBci) {
         MethodData* mdo = m->method_data();
         if (mdo != NULL) {
-          int count = mdo->bci_to_data(branch_bci)->as_JumpData()->taken();
-          tty->print_cr("back branch count = %d", count);
+          ProfileData *pd = mdo->bci_to_data(branch_bci);
+          if (pd == NULL) {
+            tty->print_cr("back branch count = N/A (missing ProfileData)");
+          } else {
+            tty->print_cr("back branch count = %d", pd->as_JumpData()->taken());
+          }
         }
       }
     }