8029366: ShouldNotReachHere error when creating an array with component type of void

Reviewed-by: kvn
This commit is contained in:
Christian Thalinger 2013-12-06 16:43:56 -08:00
parent f3fc753f26
commit e71c8df213
2 changed files with 49 additions and 0 deletions

View file

@ -2071,6 +2071,11 @@ const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const {
if (t != NULL) {
// constant oop => constant klass
if (offset == java_lang_Class::array_klass_offset_in_bytes()) {
if (t->is_void()) {
// We cannot create a void array. Since void is a primitive type return null
// klass. Users of this result need to do a null check on the returned klass.
return TypePtr::NULL_PTR;
}
return TypeKlassPtr::make(ciArrayKlass::make(t));
}
if (!t->is_klass()) {