changeset 48509:2207e2917a68

8191854: Null pointer dereference in methodData.hpp:462 Reviewed-by: kvn
author dlong
date Fri, 22 Dec 2017 22:06:54 -0800
parents 044979e94c4e
children 8441a7cea1c1
files src/hotspot/share/runtime/compilationPolicy.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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());
+          }
         }
       }
     }