diff options
author | jwilson <jwilson@squareup.com> | 2013-01-02 13:57:43 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-01-02 13:57:43 -0800 |
commit | cbac7aed2621a0d51ecddf89af0b3c4a110a17df (patch) | |
tree | b614ad8f88ff0740115768137f9e2f503d4fb1a5 | |
parent | a3df5b58369667f2fb3c4616f7e175b6ec7db412 (diff) | |
parent | 519975591eba13ae7ac4e494a0dfb88a34ca191b (diff) | |
download | android_dalvik-cbac7aed2621a0d51ecddf89af0b3c4a110a17df.tar.gz android_dalvik-cbac7aed2621a0d51ecddf89af0b3c4a110a17df.tar.bz2 android_dalvik-cbac7aed2621a0d51ecddf89af0b3c4a110a17df.zip |
am 51997559: Fail if the new index is out of range. do not merge.
* commit '519975591eba13ae7ac4e494a0dfb88a34ca191b':
Fail if the new index is out of range. do not merge.
-rw-r--r-- | dx/src/com/android/dx/merge/DexMerger.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dx/src/com/android/dx/merge/DexMerger.java b/dx/src/com/android/dx/merge/DexMerger.java index fc4d14513..b7677cf88 100644 --- a/dx/src/com/android/dx/merge/DexMerger.java +++ b/dx/src/com/android/dx/merge/DexMerger.java @@ -406,6 +406,9 @@ public final class DexMerger { } @Override void updateIndex(int offset, IndexMap indexMap, int oldIndex, int newIndex) { + if (newIndex < 0 || newIndex > 0xffff) { + throw new IllegalArgumentException("type ID not in [0, 0xffff]: " + newIndex); + } indexMap.typeIds[oldIndex] = (short) newIndex; } @@ -446,6 +449,9 @@ public final class DexMerger { } @Override void updateIndex(int offset, IndexMap indexMap, int oldIndex, int newIndex) { + if (newIndex < 0 || newIndex > 0xffff) { + throw new IllegalArgumentException("proto ID not in [0, 0xffff]: " + newIndex); + } indexMap.protoIds[oldIndex] = (short) newIndex; } @@ -466,6 +472,9 @@ public final class DexMerger { } @Override void updateIndex(int offset, IndexMap indexMap, int oldIndex, int newIndex) { + if (newIndex < 0 || newIndex > 0xffff) { + throw new IllegalArgumentException("field ID not in [0, 0xffff]: " + newIndex); + } indexMap.fieldIds[oldIndex] = (short) newIndex; } @@ -486,6 +495,9 @@ public final class DexMerger { } @Override void updateIndex(int offset, IndexMap indexMap, int oldIndex, int newIndex) { + if (newIndex < 0 || newIndex > 0xffff) { + throw new IllegalArgumentException("method ID not in [0, 0xffff]: " + newIndex); + } indexMap.methodIds[oldIndex] = (short) newIndex; } |