6623167: C2 crashed in StoreCMNode::Value
authorkvn
Tue, 11 Mar 2008 11:04:40 -0700
changeset 216 9d2d32d9828f
parent 215 a225dcee0abf
child 217 c646ef2f5d58
6623167: C2 crashed in StoreCMNode::Value Summary: C2 crashed in StoreCMNode::Value because n->in(MemNode::OopStore) is 0. Reviewed-by: rasbold, never
hotspot/src/share/vm/opto/memnode.cpp
--- a/hotspot/src/share/vm/opto/memnode.cpp	Mon Mar 10 17:21:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Tue Mar 11 11:04:40 2008 -0700
@@ -1771,9 +1771,16 @@
 
 //------------------------------Value-----------------------------------------
 const Type *StoreCMNode::Value( PhaseTransform *phase ) const {
+  // Either input is TOP ==> the result is TOP
+  const Type *t = phase->type( in(MemNode::Memory) );
+  if( t == Type::TOP ) return Type::TOP;
+  t = phase->type( in(MemNode::Address) );
+  if( t == Type::TOP ) return Type::TOP;
+  t = phase->type( in(MemNode::ValueIn) );
+  if( t == Type::TOP ) return Type::TOP;
   // If extra input is TOP ==> the result is TOP
-  const Type *t1 = phase->type( in(MemNode::OopStore) );
-  if( t1 == Type::TOP ) return Type::TOP;
+  t = phase->type( in(MemNode::OopStore) );
+  if( t == Type::TOP ) return Type::TOP;
 
   return StoreNode::Value( phase );
 }