7077439: Possible reference through NULL in loopPredicate.cpp:726

Use cl->is_valid_counted_loop() check.

Reviewed-by: never
This commit is contained in:
Vladimir Kozlov 2011-08-10 14:06:57 -07:00
parent b543a07b9a
commit 52f678435a
4 changed files with 9 additions and 7 deletions

View file

@ -2099,7 +2099,7 @@ bool IdealLoopTree::policy_do_remove_empty_loop( PhaseIdealLoop *phase ) {
if (!_head->is_CountedLoop())
return false; // Dead loop
CountedLoopNode *cl = _head->as_CountedLoop();
if (!cl->loopexit())
if (!cl->is_valid_counted_loop())
return false; // Malformed loop
if (!phase->is_member(this, phase->get_ctrl(cl->loopexit()->in(CountedLoopEndNode::TestValue))))
return false; // Infinite loop
@ -2255,7 +2255,7 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_
}
CountedLoopNode *cl = _head->as_CountedLoop();
if (!cl->loopexit()) return true; // Ignore various kinds of broken loops
if (!cl->is_valid_counted_loop()) return true; // Ignore various kinds of broken loops
// Do nothing special to pre- and post- loops
if (cl->is_pre_loop() || cl->is_post_loop()) return true;
@ -2636,7 +2636,7 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
// Must have constant stride
CountedLoopNode* head = lpt->_head->as_CountedLoop();
if (!head->stride_is_con() || !head->is_normal_loop()) {
if (!head->is_valid_counted_loop() || !head->is_normal_loop()) {
return false;
}