Index: vm/vmcore/src/class_support/Class_File_Loader.cpp =================================================================== --- vm/vmcore/src/class_support/Class_File_Loader.cpp (revision 526675) +++ vm/vmcore/src/class_support/Class_File_Loader.cpp (working copy) @@ -1746,39 +1746,51 @@ // so we have no reason to cross-check these tables // See specification 4.8.12 second paragraph. if (generic_vars && lv_table) { - unsigned j = i = 0; - for (i = 0; i < generic_vars->length && j != lv_table->length; i++) { + bool found = true; + unsigned i, j; + for (i = 0; i < generic_vars->length && found; i++) { + found = false; 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; + found = true; break; } } } - String* gvi_name = generic_vars->table[i].name; + + String* gvi_name = NULL; + if(!found) { + gvi_name = generic_vars->table[i - 1].name; + } if( num_lvtt_entries >= LV_ALLOCATION_THRESHOLD ){ STD_FREE(generic_vars); } - if(j == lv_table->length) { + if(TI_enabled) { + _local_vars_table = lv_table; + } else { + if(num_lvt_entries >= LV_ALLOCATION_THRESHOLD) { + STD_FREE(lv_table); + } + } + + if(!found) { REPORT_FAILED_METHOD("Element: "<< gvi_name->bytes << - " in LocalVariableTypeTable has no counterpart or differs from element in LocalVariableTable"); - } - } + " in LocalVariableTypeTable has no counterpart or differs from element in LocalVariableTable"); - if(TI_enabled) { - _local_vars_table = lv_table; - } else { - if(num_lvt_entries >= LV_ALLOCATION_THRESHOLD) { - STD_FREE(lv_table); + return false; } } } - //return to the right ByteReader point if(!cfs.go_to_offset(return_point)) { @@ -3149,6 +3161,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 false; } bool isinner = false; // found_myself == 2: myself is not inner class or has passed myself when iterating inner class attribute arrays