Mercurial > hg > truffle
comparison src/share/vm/opto/subnode.cpp @ 10279:70120f47d403
8014189: JVM crash with SEGV in ConnectionGraph::record_for_escape_analysis()
Summary: Add NULL checks and asserts for Type::make_ptr() returned value.
Reviewed-by: twisti
author | kvn |
---|---|
date | Thu, 09 May 2013 17:28:04 -0700 |
parents | cc32ccaaf47f |
children | c9ccd7b85f20 |
comparison
equal
deleted
inserted
replaced
10278:6f3fd5150b67 | 10279:70120f47d403 |
---|---|
861 const Type *CmpNNode::sub( const Type *t1, const Type *t2 ) const { | 861 const Type *CmpNNode::sub( const Type *t1, const Type *t2 ) const { |
862 const TypePtr *r0 = t1->make_ptr(); // Handy access | 862 const TypePtr *r0 = t1->make_ptr(); // Handy access |
863 const TypePtr *r1 = t2->make_ptr(); | 863 const TypePtr *r1 = t2->make_ptr(); |
864 | 864 |
865 // Undefined inputs makes for an undefined result | 865 // Undefined inputs makes for an undefined result |
866 if( TypePtr::above_centerline(r0->_ptr) || | 866 if ((r0 == NULL) || (r1 == NULL) || |
867 TypePtr::above_centerline(r1->_ptr) ) | 867 TypePtr::above_centerline(r0->_ptr) || |
868 TypePtr::above_centerline(r1->_ptr)) { | |
868 return Type::TOP; | 869 return Type::TOP; |
869 | 870 } |
870 if (r0 == r1 && r0->singleton()) { | 871 if (r0 == r1 && r0->singleton()) { |
871 // Equal pointer constants (klasses, nulls, etc.) | 872 // Equal pointer constants (klasses, nulls, etc.) |
872 return TypeInt::CC_EQ; | 873 return TypeInt::CC_EQ; |
873 } | 874 } |
874 | 875 |