提交 9c2a321a 编写于 作者: R rraghavan

8175345: Reported null pointer dereference defect groups

Summary: Added required explicit NULL checks
Reviewed-by: thartmann, kvn
上级 ad2270f7
...@@ -743,8 +743,8 @@ bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) { ...@@ -743,8 +743,8 @@ bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
} }
// May modify (by reflection) if an boxing object is passed // May modify (by reflection) if an boxing object is passed
// as argument or returned. // as argument or returned.
if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) { Node* proj = returns_pointer() ? proj_out(TypeFunc::Parms) : NULL;
Node* proj = proj_out(TypeFunc::Parms); if (proj != NULL) {
const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr(); const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
if ((inst_t != NULL) && (!inst_t->klass_is_exact() || if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
(inst_t->klass() == boxing_klass))) { (inst_t->klass() == boxing_klass))) {
......
...@@ -1081,8 +1081,9 @@ void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) { ...@@ -1081,8 +1081,9 @@ void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) {
// be skipped. For example, range check predicate has two checks // be skipped. For example, range check predicate has two checks
// for lower and upper bounds. // for lower and upper bounds.
ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj(); ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate)) if ((unc_proj != NULL) && (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate))) {
prev_dom = idom; prev_dom = idom;
}
// Now walk the current IfNode's projections. // Now walk the current IfNode's projections.
// Loop ends when 'this' has no more uses. // Loop ends when 'this' has no more uses.
......
...@@ -2714,6 +2714,11 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) { ...@@ -2714,6 +2714,11 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
return false; return false;
} }
Node* exit = head->loopexit()->proj_out(0);
if (exit == NULL) {
return false;
}
#ifndef PRODUCT #ifndef PRODUCT
if (TraceLoopOpts) { if (TraceLoopOpts) {
tty->print("ArrayFill "); tty->print("ArrayFill ");
...@@ -2831,7 +2836,6 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) { ...@@ -2831,7 +2836,6 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
*/ */
// Redirect the old control and memory edges that are outside the loop. // Redirect the old control and memory edges that are outside the loop.
Node* exit = head->loopexit()->proj_out(0);
// Sometimes the memory phi of the head is used as the outgoing // Sometimes the memory phi of the head is used as the outgoing
// state of the loop. It's safe in this case to replace it with the // state of the loop. It's safe in this case to replace it with the
// result_mem. // result_mem.
......
...@@ -891,8 +891,9 @@ bool StringConcat::validate_control_flow() { ...@@ -891,8 +891,9 @@ bool StringConcat::validate_control_flow() {
ctrl_path.push(cn); ctrl_path.push(cn);
ctrl_path.push(cn->proj_out(0)); ctrl_path.push(cn->proj_out(0));
ctrl_path.push(cn->proj_out(0)->unique_out()); ctrl_path.push(cn->proj_out(0)->unique_out());
if (cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0) != NULL) { Node* catchproj = cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0);
ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0)); if (catchproj != NULL) {
ctrl_path.push(catchproj);
} }
} else { } else {
ShouldNotReachHere(); ShouldNotReachHere();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册