mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 16:44:25 +02:00
tweak assertions
git-svn-id: https://smali.googlecode.com/svn/trunk@386 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
8922ca1c4c
commit
d8b31a17ae
@ -78,7 +78,7 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
|||||||
* @return The offset of the byte following this item
|
* @return The offset of the byte following this item
|
||||||
*/
|
*/
|
||||||
protected int placeAt(int offset, int index) {
|
protected int placeAt(int offset, int index) {
|
||||||
assert offset % getItemType().ItemAlignment == 0:"The offset is not aligned";
|
assert offset % getItemType().ItemAlignment == 0;
|
||||||
assert !dexFile.getInplace() || (offset == this.offset && this.index == index);
|
assert !dexFile.getInplace() || (offset == this.offset && this.index == index);
|
||||||
|
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
@ -91,12 +91,8 @@ public abstract class Item<T extends Item> implements Comparable<T> {
|
|||||||
* @param out The output stream to write and annotate to
|
* @param out The output stream to write and annotate to
|
||||||
*/
|
*/
|
||||||
protected void writeTo(AnnotatedOutput out) {
|
protected void writeTo(AnnotatedOutput out) {
|
||||||
assert out.getCursor() % getItemType().ItemAlignment == 0:"The Output cursor is not aligned";
|
assert out.getCursor() % getItemType().ItemAlignment == 0;
|
||||||
|
assert out.getCursor() == offset;
|
||||||
if (out.getCursor() != offset) {
|
|
||||||
throw new RuntimeException("Item was placed at offset 0x" + Integer.toHexString(offset) +
|
|
||||||
" but is being written to offset 0x" + Integer.toHexString(out.getCursor()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (out.annotates()) {
|
if (out.annotates()) {
|
||||||
out.annotate(0, "[0x" + Integer.toHexString(index) + "] " + this.getItemType().TypeName);
|
out.annotate(0, "[0x" + Integer.toHexString(index) + "] " + this.getItemType().TypeName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user