Mercurial > hg > truffle
comparison src/share/vm/oops/generateOopMap.cpp @ 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 | f16e75e0cf11 |
children | f75faf51e8c4 |
comparison
equal
deleted
inserted
replaced
8771:75a28f465a12 | 8773:2eef6d34833b |
---|---|
760 // depths match up then their states are merged. Otherwise the | 760 // depths match up then their states are merged. Otherwise the |
761 // mismatch is simply recorded and interpretation continues since | 761 // mismatch is simply recorded and interpretation continues since |
762 // monitor matching is purely informational and doesn't say anything | 762 // monitor matching is purely informational and doesn't say anything |
763 // about the correctness of the code. | 763 // about the correctness of the code. |
764 void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) { | 764 void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) { |
765 guarantee(bb != NULL, "null basicblock"); | |
765 assert(bb->is_alive(), "merging state into a dead basicblock"); | 766 assert(bb->is_alive(), "merging state into a dead basicblock"); |
766 | 767 |
767 if (_stack_top == bb->_stack_top) { | 768 if (_stack_top == bb->_stack_top) { |
768 // always merge local state even if monitors don't match. | 769 // always merge local state even if monitors don't match. |
769 if (merge_local_state_vectors(_state, bb->_state)) { | 770 if (merge_local_state_vectors(_state, bb->_state)) { |
1187 int handler_pc = exct.handler_pc(i); | 1188 int handler_pc = exct.handler_pc(i); |
1188 int catch_type = exct.catch_type_index(i); | 1189 int catch_type = exct.catch_type_index(i); |
1189 | 1190 |
1190 if (start_pc <= bci && bci < end_pc) { | 1191 if (start_pc <= bci && bci < end_pc) { |
1191 BasicBlock *excBB = get_basic_block_at(handler_pc); | 1192 BasicBlock *excBB = get_basic_block_at(handler_pc); |
1193 guarantee(excBB != NULL, "no basic block for exception"); | |
1192 CellTypeState *excStk = excBB->stack(); | 1194 CellTypeState *excStk = excBB->stack(); |
1193 CellTypeState *cOpStck = stack(); | 1195 CellTypeState *cOpStck = stack(); |
1194 CellTypeState cOpStck_0 = cOpStck[0]; | 1196 CellTypeState cOpStck_0 = cOpStck[0]; |
1195 int cOpStackTop = _stack_top; | 1197 int cOpStackTop = _stack_top; |
1196 | 1198 |
1801 // this monitorexit will be visited again. We need to | 1803 // this monitorexit will be visited again. We need to |
1802 // do this to ensure that we have accounted for the | 1804 // do this to ensure that we have accounted for the |
1803 // possibility that this bytecode will throw an | 1805 // possibility that this bytecode will throw an |
1804 // exception. | 1806 // exception. |
1805 BasicBlock* bb = get_basic_block_containing(bci); | 1807 BasicBlock* bb = get_basic_block_containing(bci); |
1808 guarantee(bb != NULL, "no basic block for bci"); | |
1806 bb->set_changed(true); | 1809 bb->set_changed(true); |
1807 bb->_monitor_top = bad_monitors; | 1810 bb->_monitor_top = bad_monitors; |
1808 | 1811 |
1809 if (TraceMonitorMismatch) { | 1812 if (TraceMonitorMismatch) { |
1810 report_monitor_mismatch("improper monitor pair"); | 1813 report_monitor_mismatch("improper monitor pair"); |
2188 // We now want to report the result of the parse | 2191 // We now want to report the result of the parse |
2189 _report_result = true; | 2192 _report_result = true; |
2190 | 2193 |
2191 // Find basicblock and report results | 2194 // Find basicblock and report results |
2192 BasicBlock* bb = get_basic_block_containing(bci); | 2195 BasicBlock* bb = get_basic_block_containing(bci); |
2196 guarantee(bb != NULL, "no basic block for bci"); | |
2193 assert(bb->is_reachable(), "getting result from unreachable basicblock"); | 2197 assert(bb->is_reachable(), "getting result from unreachable basicblock"); |
2194 bb->set_changed(true); | 2198 bb->set_changed(true); |
2195 interp_bb(bb); | 2199 interp_bb(bb); |
2196 } | 2200 } |
2197 | 2201 |