History log of /libcore/dex/src/main/java/com/android/dex/Code.java
Revision Date Author Comments
00a2d1ee4cfee1f33344c3798940bbae22f96187 05-Sep-2012 Benoit Lamarche <benoitlamarche@google.com> Fix an ugly bug where try/catch offsets weren't being mapped properly

This CL comes from CL I3bdadf20899fdb5d4d074e69103b33c0404a31f8 in AOSP master.
Modifications have been made to files that were in dalvik but are now in libcore.
Here is the original commit message:

In dex files, there are several places where one object refers
to another object by its position in the file. The dex merger
is generally very careful to adjust these mappings when combining
dex files.

Unfortunately one of these cases was broken. Each try_item refers
to a corresponding encoded_catch_handler by its byte offset in a
list. Most of the time this byte offset is the same in the input
dex file and the output dex file. But encoded_catch_handlers are
variable-length because they use a variable-length uleb128 encoding
to address the type_idx being caught. When dex files are merged,
some exception types may go from having a small index to having
a large index, increasing the number of bytes required to encode
that index. This breaks our ability to directly copy over offsets
as we were doing previously.

Change-Id: I61adb8fce6fa9b83cbfbe5eef7edea84664d7ea6
(cherry picked from commit b44450d600807ab130aa7c6d91b534fde52e0a21)
2bea5ee615b0f4add658d5660bd81c5145a0d05e 18-Sep-2011 Jesse Wilson <jessewilson@google.com> Move dex utilities from dalvik/dx to libcore/dex part 2

Change-Id: Ib5bb7bec80d77464f632f1cdfef708d868301c42
(cherry picked from commit 9ae95d8f3381204108abc722e8e5a03d6ecbf311)