changeset 8773:2eef6d34833b

8009022: [parfait] Null pointer deference in hotspot/src/share/vm/oops/generateOopMap.cpp Summary: add guarantee() checks to merge_state_into_bb() Reviewed-by: kvn
author morris
date Tue, 19 Mar 2013 11:49:36 -0700
parents 75a28f465a12
children 3b9368710f08
files src/share/vm/oops/generateOopMap.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/generateOopMap.cpp	Tue Mar 19 07:23:29 2013 -0700
+++ b/src/share/vm/oops/generateOopMap.cpp	Tue Mar 19 11:49:36 2013 -0700
@@ -762,6 +762,7 @@
 // monitor matching is purely informational and doesn't say anything
 // about the correctness of the code.
 void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) {
+  guarantee(bb != NULL, "null basicblock");
   assert(bb->is_alive(), "merging state into a dead basicblock");
 
   if (_stack_top == bb->_stack_top) {
@@ -1189,6 +1190,7 @@
 
       if (start_pc <= bci && bci < end_pc) {
         BasicBlock *excBB = get_basic_block_at(handler_pc);
+        guarantee(excBB != NULL, "no basic block for exception");
         CellTypeState *excStk = excBB->stack();
         CellTypeState *cOpStck = stack();
         CellTypeState cOpStck_0 = cOpStck[0];
@@ -1803,6 +1805,7 @@
     // possibility that this bytecode will throw an
     // exception.
     BasicBlock* bb = get_basic_block_containing(bci);
+    guarantee(bb != NULL, "no basic block for bci");
     bb->set_changed(true);
     bb->_monitor_top = bad_monitors;
 
@@ -2190,6 +2193,7 @@
 
   // Find basicblock and report results
   BasicBlock* bb = get_basic_block_containing(bci);
+  guarantee(bb != NULL, "no basic block for bci");
   assert(bb->is_reachable(), "getting result from unreachable basicblock");
   bb->set_changed(true);
   interp_bb(bb);