diff src/share/vm/opto/subnode.cpp @ 783:a9e116455022

6832293: JIT compiler got wrong result in type checking with -server Summary: Check for an object array of interface in CmpPNode::sub(). Reviewed-by: never
author kvn
date Mon, 11 May 2009 17:59:54 -0700
parents 90a66aa50514
children bd02caa94611
line wrap: on
line diff
--- a/src/share/vm/opto/subnode.cpp	Fri May 08 23:00:08 2009 -0700
+++ b/src/share/vm/opto/subnode.cpp	Mon May 11 17:59:54 2009 -0700
@@ -640,7 +640,11 @@
     if (klass0 && klass1 &&
         kps != 1 &&             // both or neither are klass pointers
         klass0->is_loaded() && !klass0->is_interface() && // do not trust interfaces
-        klass1->is_loaded() && !klass1->is_interface()) {
+        klass1->is_loaded() && !klass1->is_interface() &&
+        (!klass0->is_obj_array_klass() ||
+         !klass0->as_obj_array_klass()->base_element_klass()->is_interface()) &&
+        (!klass1->is_obj_array_klass() ||
+         !klass1->as_obj_array_klass()->base_element_klass()->is_interface())) {
       bool unrelated_classes = false;
       // See if neither subclasses the other, or if the class on top
       // is precise.  In either of these cases, the compare is known