< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page
rev 48500 : 8194988: 8 Null pointer dereference defect groups related to MultiNode::proj_out()

@@ -770,11 +770,11 @@
   }
   if (t_oop->is_ptr_to_boxed_value()) {
     ciKlass* boxing_klass = t_oop->klass();
     if (is_CallStaticJava() && as_CallStaticJava()->is_boxing_method()) {
       // Skip unrelated boxing methods.
-      Node* proj = proj_out(TypeFunc::Parms);
+      Node* proj = proj_out_or_null(TypeFunc::Parms);
       if ((proj == NULL) || (phase->type(proj)->is_instptr()->klass() != boxing_klass)) {
         return false;
       }
     }
     if (is_CallJava() && as_CallJava()->method() != NULL) {

@@ -782,11 +782,11 @@
       if (meth->is_getter()) {
         return false;
       }
       // May modify (by reflection) if an boxing object is passed
       // as argument or returned.
-      Node* proj = returns_pointer() ? proj_out(TypeFunc::Parms) : NULL;
+      Node* proj = returns_pointer() ? proj_out_or_null(TypeFunc::Parms) : NULL;
       if (proj != NULL) {
         const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
         if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
                                  (inst_t->klass() == boxing_klass))) {
           return true;

@@ -822,11 +822,11 @@
 // or 'this' if there are several CheckCastPP or unexpected uses
 // or returns NULL if there is no one.
 Node *CallNode::result_cast() {
   Node *cast = NULL;
 
-  Node *p = proj_out(TypeFunc::Parms);
+  Node *p = proj_out_or_null(TypeFunc::Parms);
   if (p == NULL)
     return NULL;
 
   for (DUIterator_Fast imax, i = p->fast_outs(imax); i < imax; i++) {
     Node *use = p->fast_out(i);

@@ -1376,17 +1376,17 @@
   if (type->isa_int() && type->is_int()->_hi < 0) {
     if (can_reshape) {
       PhaseIterGVN *igvn = phase->is_IterGVN();
       // Unreachable fall through path (negative array length),
       // the allocation can only throw so disconnect it.
-      Node* proj = proj_out(TypeFunc::Control);
+      Node* proj = proj_out_or_null(TypeFunc::Control);
       Node* catchproj = NULL;
       if (proj != NULL) {
         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
           Node *cn = proj->fast_out(i);
           if (cn->is_Catch()) {
-            catchproj = cn->as_Multi()->proj_out(CatchProjNode::fall_through_index);
+            catchproj = cn->as_Multi()->proj_out_or_null(CatchProjNode::fall_through_index);
             break;
           }
         }
       }
       if (catchproj != NULL && catchproj->outcnt() > 0 &&

@@ -1440,11 +1440,11 @@
       // Return NULL if new nodes are not allowed
       if (!allow_new_nodes) return NULL;
       // Create a cast which is control dependent on the initialization to
       // propagate the fact that the array length must be positive.
       length = new CastIINode(length, narrow_length_type);
-      length->set_req(0, initialization()->proj_out(0));
+      length->set_req(0, initialization()->proj_out_or_null(0));
     }
   }
 
   return length;
 }
< prev index next >