Fixed an issue with generated dex files that have no field references

git-svn-id: https://smali.googlecode.com/svn/trunk@57 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2009-06-02 05:52:15 +00:00
parent 4fd96cb22d
commit 56c3e45ad4

View File

@ -55,8 +55,15 @@ public abstract class SectionHeaderInfo extends CompositeField<SectionHeaderInfo
if (!section.isPlaced()) {
throw new RuntimeException("Trying to write a reference to a section that hasn't been placed.");
}
int size = section.size();
sectionSizeField.cacheValue(section.size());
sectionOffsetField.cacheValue(section.getOffset());
if (size == 0) {
//we have to set the offset to 0 or dalvik will complain
sectionOffsetField.cacheValue(0);
} else {
sectionOffsetField.cacheValue(section.getOffset());
}
super.writeTo(out);
}