harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r596573 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/class_interface.h src/class_support/class_impl.cpp src/verifier-3363/base/tpool.cpp
Date Tue, 20 Nov 2007 08:51:21 GMT
Author: mloenko
Date: Tue Nov 20 00:51:18 2007
New Revision: 596573

URL: http://svn.apache.org/viewvc?rev=596573&view=rev
Log:
fixed HARMONY-5141 (verifier makes incorrect assumption about validness of classloader delegation
model)

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h?rev=596573&r1=596572&r2=596573&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_interface.h Tue Nov 20 00:51:18 2007
@@ -179,11 +179,11 @@
  * @param klass      - checked klass
  * @param super_name - parent class name
  * @return If given class extends current class with given name,
- *         function returns 1, else function returns 0.
+ *         function returns its class handler, else function returns 0.
  * @note Assertion is raised if <i>klass</i> or <i>super_name</i>
are equal to null.
  */
-unsigned
-class_is_extending_class( class_handler klass, char *super_name );
+class_handler
+class_is_extending_class( class_handler klass, const char *super_name );
 
 /**
  * Function returns number of methods for current class.

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp?rev=596573&r1=596572&r2=596573&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/class_impl.cpp Tue Nov 20 00:51:18
2007
@@ -171,15 +171,19 @@
 /**
  * Function checks if class extends current class with given name.
  */
-unsigned
-class_is_extending_class( class_handler klass, char *super_name )
+class_handler
+class_is_extending_class( class_handler klass, const char *super_name )
 {
     assert( klass );
     assert( super_name );
+
+    Global_Env *env = VM_Global_State::loader_env;
+    String *pooled_name = env->string_pool.lookup( super_name );
+
     for( Class *clss = (Class*)klass; clss; clss = clss->get_super_class() ) {
-        if( !strcmp( clss->get_name()->bytes, super_name ) ) {
+        if( clss->get_name() == pooled_name ) {
             // found class with given name
-            return 1;
+            return (class_handler)clss;
         }
     }
     return 0;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp?rev=596573&r1=596572&r2=596573&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier-3363/base/tpool.cpp Tue Nov 20 00:51:18
2007
@@ -272,15 +272,14 @@
         }
 
         if( referred == CLASS_NOT_LOADED ) {
-            //referred class can't be resolved ==> it's not a super class
-//#ifndef NDEBUG
-//            class_handler k = k_class;
-//            while(k) {
-//                assert(strcmp(class_get_name(k), expected_type->name));
-//                k = class_get_super_class(k);
-//            }
-//#endif
-            return false;
+            //referred class can't be resolved ==> still might be a super class
+            class_handler k = class_is_extending_class(k_class, expected_type->name);
+
+            if( k ) {
+                referred = k;
+            } else {
+                return false;
+            }
         }
 
         return !class_is_same_package(k_class, referred) && vf_is_extending(k_class,
referred);



Mime
View raw message