harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r526725 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
Date Mon, 09 Apr 2007 12:15:21 GMT
Author: varlax
Date: Mon Apr  9 05:15:21 2007
New Revision: 526725

URL: http://svn.apache.org/viewvc?view=rev&rev=526725
Log:
Workaround for HARMONY-3575 [drlvm][eclipse] One class in Pydev fails classloading
+ a few leaks and error message fixes.

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=526725&r1=526724&r2=526725
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Mon Apr
 9 05:15:21 2007
@@ -1444,7 +1444,7 @@
                 &&table->table[j].length == table->table[i].length
                 &&table->table[j].index == table->table[i].index)
             {
-                REPORT_FAILED_METHOD("Duplicate local variable "<< table->table[j].name
+                REPORT_FAILED_METHOD("Duplicate local variable "<< table->table[j].name->bytes
                     << " in attribute " << attr_name);
                 return false;
             }
@@ -1735,38 +1735,45 @@
         }
         lv_table->length = num_lvt_entries;
 
+        bool failed = false;
         if (!_parse_local_vars(lv_table, offset_lvt_array, cp, cfs,
                 "LocalVariableTable", ATTR_LocalVariableTable)
             || (generic_vars && !_parse_local_vars(generic_vars, offset_lvtt_array,
cp, cfs,
                 "LocalVariableTypeTable", ATTR_LocalVariableTypeTable)))
         {
-            return false;
+            failed = true;
         }
         // JVM spec hints that LocalVariableTypeTable is meant to be a supplement to LocalVariableTable
-        // so we have no reason to cross-check these tables
-        // See specification 4.8.12 second paragraph.
-        if (generic_vars && lv_table) {
+        // See specification 4.8.13 second paragraph.
+        if (!failed && generic_vars) {
             unsigned j = i = 0;
-            for (i = 0; i < generic_vars->length && j != lv_table->length;
i++) {
+            for (i = 0; i < generic_vars->length; i++) {
                 for (j = 0; j < lv_table->length; j++) {
                     if (generic_vars->table[i].name == lv_table->table[j].name
                         && generic_vars->table[i].start_pc == lv_table->table[j].start_pc
-                        && generic_vars->table[i].length == lv_table->table[j].length
+                        /* FIXME This is temporary solution. One broken class file
+                        was found in eclipse plugin. RI loads this class successfully, DRLVM
doesn't.
+                        Tests show that this depends on classloader, so further evaluation
is needed
+                        to fix it permanently. */
+                        //&& generic_vars->table[i].length == lv_table->table[j].length
                         &&  generic_vars->table[i].index == lv_table->table[j].index)
                     {
                         lv_table->table[j].generic_type = generic_vars->table[i].type;
                         break;
                     }
                 }
+                if(j == lv_table->length) {
+                    String* gvi_name = generic_vars->table[i].name;
+                    REPORT_FAILED_METHOD("Element "<< gvi_name->bytes <<
+                        " of LocalVariableTypeTable does not match any of LocalVariableTable
entries");
+                    failed = true;
+                    break;
+                }
+                
             }
-            String* gvi_name = generic_vars->table[i].name;
             if( num_lvtt_entries >= LV_ALLOCATION_THRESHOLD ){
                 STD_FREE(generic_vars);
             }
-            if(j == lv_table->length) {
-                REPORT_FAILED_METHOD("Element: "<< gvi_name->bytes <<
-                    " in LocalVariableTypeTable has no counterpart or differs from element
in LocalVariableTable");
-            }
         }
 
         if(TI_enabled) {
@@ -1776,6 +1783,9 @@
                 STD_FREE(lv_table);
             }
         }
+        if (failed) {
+            return false;
+        }
     }
 
 
@@ -3149,6 +3159,7 @@
             //See specification 4.8.5 about InnerClasses Attribute
             if (m_declaring_class_index || m_innerclasses) {
                 REPORT_FAILED_CLASS_FORMAT(this, "more than one InnerClasses attribute");
+                return true;
             }
             bool isinner = false;
             // found_myself == 2: myself is not inner class or has passed myself when iterating
inner class attribute arrays



Mime
View raw message