Initialize the offset of ClassDefItems to -1 before placing them

git-svn-id: https://smali.googlecode.com/svn/trunk@423 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-08-26 04:42:18 +00:00
parent e88cdf2010
commit 0da75f71eb
2 changed files with 8 additions and 2 deletions

View File

@ -268,6 +268,12 @@ public class ClassDefItem extends Item<ClassDefItem> {
});
}
//we need to initialize the offset for all the classes to -1, so we can tell which ones
//have been placed
for (ClassDefItem classDefItem: section.items) {
classDefItem.offset = -1;
}
for (ClassDefItem classDefItem: section.items) {
placeClass(classDefItem);
}

View File

@ -36,12 +36,12 @@ public abstract class Item<T extends Item> implements Comparable<T> {
/**
* The offset of this item in the dex file, or -1 if not known
*/
private int offset = -1;
protected int offset = -1;
/**
* The index of this item in the containing section, or -1 if not known
*/
private int index = -1;
protected int index = -1;
/**
* The DexFile that this item is associatedr with