diff paraspace/dex_deptracker.py @ 57:fa8fe7d714b9

Fix semantic bug of dexfile.depend_off_rel by searching relative offset. - _DEX_Try.handlerOff is not one2one mapped to a _DEX_Catch of common _DEX_Code object. - But, previous _link_dependencies() was wrote based on this idea. - This changeset fix the behavior by searching depend-on object with right offset related to 'relative_to' object of the 'depend_off_rel' instance.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 25 Jun 2011 08:16:16 +0800
parents 7f23def22a95
children c2a4921ec83b
line wrap: on
line diff
--- a/paraspace/dex_deptracker.py	Fri Jun 24 10:56:33 2011 +0800
+++ b/paraspace/dex_deptracker.py	Sat Jun 25 08:16:16 2011 +0800
@@ -519,7 +519,7 @@
             name_path1 = dep[1]
             if name_path1 not in all_markers:
                 all_markers.add(name_path1)
-                _install_rel_offset_marker(name_path1)
+                _install_offset_marker(name_path1)
                 pass
             
             name_path2 = dep[2]
@@ -715,8 +715,9 @@
         dep = all_dep_decls[name_path]
         dep_type = dep[0]
         if dep_type == dexfile.depend_off_rel:
-            depon1 = _rel_offset_marker.find_depon(dep[1], parents)
             depon2 = _rel_offset_marker.find_depon(dep[2], parents)
+            offset = depon2.data_offset + obj
+            depon1 = markers_info[dep[1]][offset]
 
             name = name_path.split('.')[-1]
             _dex_tree_set_child(imm_parent, name, (depon1, depon2))