changeset 134:3dee4d929e1f

Wrap _DEX_TypeList to _DEX_TypeList_align before append to list. - Fix the issue described by map_verify_error_test(). - When inject a _DEX_ClassDef, dexfile_insert_classdefs_relative() should also inject related _DEX_TypeList. - But, dex_append_obj_list() does not known that _DEX_TypeList should be wrapped to to _DEX_TypeList_align and appended to DEXFile.typeLists. We add a special case in dex_append_obj_list() to wrap _DEX_TypeList before trying to insert to a list.
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 09 Aug 2011 17:23:01 +0800
parents ddf8a20ecc4b
children b488ca519709
files paraspace/injection.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/injection.py	Tue Aug 09 17:16:43 2011 +0800
+++ b/paraspace/injection.py	Tue Aug 09 17:23:01 2011 +0800
@@ -76,6 +76,13 @@
 def dex_append_obj_list(dex, obj):
     from paraspace.dex_deptracker import _dex_tree_get_child
     from paraspace.dex_deptracker import _dex_tree_set_child
+    from paraspace.dexfile import _DEX_TypeList, _DEX_TypeList_align
+
+    if isinstance(obj, _DEX_TypeList):
+        wrapper = _DEX_TypeList_align()
+        wrapper.value = obj
+        obj = wrapper
+        pass
 
     type_2_attr = dex_type_2_array_attr_map()
     try: