8073957: assert(ary_src != 0) failed: not an array or instance?
authorroland
Tue, 03 Mar 2015 12:30:07 +0100
changeset 29360 dd9daceb5f3d
parent 29359 1afd344fc185
child 29361 ae2aef8d8ab9
8073957: assert(ary_src != 0) failed: not an array or instance? Summary: ArrayCopyNode going dead needs better validation of inputs Reviewed-by: kvn, vlivanov
hotspot/src/share/vm/opto/arraycopynode.cpp
--- a/hotspot/src/share/vm/opto/arraycopynode.cpp	Mon Mar 02 18:12:06 2015 +0000
+++ b/hotspot/src/share/vm/opto/arraycopynode.cpp	Tue Mar 03 12:30:07 2015 +0100
@@ -145,7 +145,6 @@
   Node* in_mem = in(TypeFunc::Memory);
 
   const Type* src_type = phase->type(src);
-  const Type* dest_type = phase->type(dest);
 
   assert(src->is_AddP(), "should be base + off");
   assert(dest->is_AddP(), "should be base + off");
@@ -483,7 +482,20 @@
     return NULL;
   }
 
-  if (in(TypeFunc::Control)->is_top() || in(TypeFunc::Memory)->is_top()) {
+  assert(in(TypeFunc::Control) != NULL &&
+         in(TypeFunc::Memory) != NULL &&
+         in(ArrayCopyNode::Src) != NULL &&
+         in(ArrayCopyNode::Dest) != NULL &&
+         in(ArrayCopyNode::Length) != NULL &&
+         ((in(ArrayCopyNode::SrcPos) != NULL && in(ArrayCopyNode::DestPos) != NULL) ||
+          is_clonebasic()), "broken inputs");
+
+  if (in(TypeFunc::Control)->is_top() ||
+      in(TypeFunc::Memory)->is_top() ||
+      phase->type(in(ArrayCopyNode::Src)) == Type::TOP ||
+      phase->type(in(ArrayCopyNode::Dest)) == Type::TOP ||
+      (in(ArrayCopyNode::SrcPos) != NULL && in(ArrayCopyNode::SrcPos)->is_top()) ||
+      (in(ArrayCopyNode::DestPos) != NULL && in(ArrayCopyNode::DestPos)->is_top())) {
     return NULL;
   }