harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r563012 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp
Date Mon, 06 Aug 2007 03:00:05 GMT
Author: mloenko
Date: Sun Aug  5 20:00:04 2007
New Revision: 563012

URL: http://svn.apache.org/viewvc?view=rev&rev=563012
Log:
fixed HARMONY-4539 and HARMONY-4540 (assignment of arrays to interfaces)

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp?view=diff&rev=563012&r1=563011&r2=563012
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/tpool.cpp Sun Aug  5 20:00:04
2007
@@ -217,27 +217,35 @@
                 //to must be Object or an interface
                 return ref_mustbe_assignable(sm_get_const_object(), get_type(to_name + dim)
);
             }
+        } else if( from_array ) {
+            //from is an array, to is not an array
+
+            //must be checked before
+            assert( from != to );
+
+            return to == sm_get_const_object() || !strcmp(to_name, "java.lang.Cloneable")
|| 
+                    !strcmp(to_name, "java.io.Serializable");
         } else {
+            //both not arrays
+
             //check whether TO class is loaded
             if( !to_type->cls ) {
                 to_type->cls = vf_resolve_class(k_class, to_type->name, false);
                 if( !to_type->cls ) to_type->cls = CLASS_NOT_LOADED;
             }
-
-            if( to_type->cls && to_type->cls != CLASS_NOT_LOADED ) {
-                //if to is loaded and it is an interface, treat it as an object
-                if( class_is_interface_( to_type->cls ) ) {
-                    return true;
-                }
-            } else {
-                NewConstraint(from_type->name, to_type->name);
-                return true;
-            }
-
-
+
+            if( to_type->cls && to_type->cls != CLASS_NOT_LOADED ) {
+                //if to is loaded and it is an interface, treat it as an object
+                if( class_is_interface_( to_type->cls ) ) {
+                    return true;
+                }
+            } else {
+                NewConstraint(from_type->name, to_type->name);
+                return true;
+            }
+
             //check whether FROM class is loaded
 
-            if( from_array ) from = sm_get_const_object();
 
             if( !from_type->cls ) {
                 from_type->cls = vf_resolve_class(k_class, from_type->name, false);



Mime
View raw message