changeset 144:46e40afd4558

Fix bug of typo in dex_sort_sorted_arrays_consistent()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 15 Aug 2011 11:13:56 +0800
parents c56c7cf32b88
children c4324c3461e8
files paraspace/injection.py paraspace/tests/injection_test.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/paraspace/injection.py	Mon Aug 15 10:08:43 2011 +0800
+++ b/paraspace/injection.py	Mon Aug 15 11:13:56 2011 +0800
@@ -735,7 +735,7 @@
 
     new_typeids = dex_linked.typeIds.items
     new_methodids = dex_linked.methodIds.items
-    methodidxs_map, typeidxs_map = \
+    typeidxs_map, methodidxs_map = \
         _make_idx_map(saved_typeids, saved_methodids, \
                           new_typeids, new_methodids)
     
--- a/paraspace/tests/injection_test.py	Mon Aug 15 10:08:43 2011 +0800
+++ b/paraspace/tests/injection_test.py	Mon Aug 15 11:13:56 2011 +0800
@@ -698,6 +698,9 @@
             method = hello_linked.find_method_idx(methodidx)
             blk = dexfile.DEXFile_linked.get_code_block_method(method)
             opvectors = decode_insn_blk(blk)
+            # Check correctness of typeid of a new_instance.
+            # This is an error of dex_sort_sorted_arrays_consistent().
+            assert opvectors[2][1][1] < len(hello_linked.typeIds.items)
             pass
         pass
     pass