changeset 48977:324105aaeddf

8197828: Null pointer dereference in MultiNode::proj_out_or_null Summary: Added a null check for the return value of AllocateNode::initialization(). Reviewed-by: kvn, shade, dlong
author thartmann
date Thu, 15 Feb 2018 09:17:56 +0100
parents 2c35fd3c5789
children 083e6c55a28c
files src/hotspot/share/opto/callnode.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/callnode.cpp	Wed Feb 14 17:20:59 2018 -0500
+++ b/src/hotspot/share/opto/callnode.cpp	Thu Feb 15 09:17:56 2018 +0100
@@ -1441,8 +1441,10 @@
       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.
+      InitializeNode* init = initialization();
+      assert(init != NULL, "initialization not found");
       length = new CastIINode(length, narrow_length_type);
-      length->set_req(0, initialization()->proj_out_or_null(0));
+      length->set_req(0, init->proj_out_or_null(0));
     }
   }