comparison paraspace/dex_deptracker.py @ 142:50d09eba5166

Fix the issue of getting negative indices for _DEX_ClassData. - It caused by calling _optimize_classdata() at end of restore_dependencies() while the values cames from depend_idx_rel.get_value(). The values had been optimized. - Solution is to get value from <child>.data_idx while unlinking.
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 15 Aug 2011 10:04:12 +0800
parents 90690a001172
children
comparison
equal deleted inserted replaced
141:90690a001172 142:50d09eba5166
1178 elif dep_type == dexfile.depend_idx: 1178 elif dep_type == dexfile.depend_idx:
1179 depon = obj 1179 depon = obj
1180 set_child(node, depon.data_idx) 1180 set_child(node, depon.data_idx)
1181 elif dep_type == dexfile.depend_idx_rel: 1181 elif dep_type == dexfile.depend_idx_rel:
1182 dep, dummy = _resolve_name_path(node.origin_path) 1182 dep, dummy = _resolve_name_path(node.origin_path)
1183 idx = dep.get_value(obj, parents) 1183 idx = obj.data_idx
1184 set_child(node, idx) 1184 set_child(node, idx)
1185 else: 1185 else:
1186 raise TypeError, 'invalid depend type %s' % (repr(dep_type)) 1186 raise TypeError, 'invalid depend type %s' % (repr(dep_type))
1187 pass 1187 pass
1188 1188
1189 _optimize_classdata(dexroot)
1189 _sync_DEXFile_fields(dexroot) 1190 _sync_DEXFile_fields(dexroot)
1190 _optimize_classdata(dexroot)
1191 pass 1191 pass
1192 1192
1193 1193
1194 ## \brief Prepare and return dependency declares. 1194 ## \brief Prepare and return dependency declares.
1195 def prepare_dep_decls(): 1195 def prepare_dep_decls():