Fix a multitude of format related issues with immutable instructions

This commit is contained in:
Ben Gruver 2012-10-23 22:50:45 -07:00
parent 0033480503
commit e2f2c89ddc
10 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class ImmutableInstruction10t extends ImmutableInstruction implements Instruction10t { public class ImmutableInstruction10t extends ImmutableInstruction implements Instruction10t {
public static final Format FORMAT = Format.Format12x; public static final Format FORMAT = Format.Format10t;
public final int codeOffset; public final int codeOffset;

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class ImmutableInstruction20t extends ImmutableInstruction implements Instruction20t { public class ImmutableInstruction20t extends ImmutableInstruction implements Instruction20t {
public static final Format FORMAT = Format.Format12x; public static final Format FORMAT = Format.Format20t;
public final int codeOffset; public final int codeOffset;

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22b extends ImmutableInstruction implements Ins
int registerB, int registerB,
int literal) { int literal) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA); this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkByteRegister(registerB); this.registerB = Preconditions.checkByteRegister(registerB);
this.literal = Preconditions.checkByteLiteral(literal); this.literal = Preconditions.checkByteLiteral(literal);

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22s extends ImmutableInstruction implements Ins
int registerB, int registerB,
int literal) { int literal) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkNibbleRegister(registerA); this.registerA = Preconditions.checkNibbleRegister(registerA);
this.registerB = Preconditions.checkNibbleRegister(registerB); this.registerB = Preconditions.checkNibbleRegister(registerB);
this.literal = Preconditions.checkShortLiteral(literal); this.literal = Preconditions.checkShortLiteral(literal);

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22t extends ImmutableInstruction implements Ins
int registerB, int registerB,
int codeOffset) { int codeOffset) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkNibbleRegister(registerA); this.registerA = Preconditions.checkNibbleRegister(registerA);
this.registerB = Preconditions.checkNibbleRegister(registerB); this.registerB = Preconditions.checkNibbleRegister(registerB);
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset); this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);

View File

@ -48,7 +48,7 @@ public class ImmutableInstruction22x extends ImmutableInstruction implements Ins
int registerA, int registerA,
int registerB) { int registerB) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA); this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkShortRegister(registerB); this.registerB = Preconditions.checkShortRegister(registerB);
} }

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction23x extends ImmutableInstruction implements Ins
int registerB, int registerB,
int registerC) { int registerC) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA); this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkByteRegister(registerB); this.registerB = Preconditions.checkByteRegister(registerB);
this.registerC = Preconditions.checkByteRegister(registerC); this.registerC = Preconditions.checkByteRegister(registerC);

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class ImmutableInstruction30t extends ImmutableInstruction implements Instruction30t { public class ImmutableInstruction30t extends ImmutableInstruction implements Instruction30t {
public static final Format FORMAT = Format.Format12x; public static final Format FORMAT = Format.Format30t;
public final int codeOffset; public final int codeOffset;

View File

@ -48,7 +48,7 @@ public class ImmutableInstruction32x extends ImmutableInstruction implements Ins
int registerA, int registerA,
int registerB) { int registerB) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkShortRegister(registerA); this.registerA = Preconditions.checkShortRegister(registerA);
this.registerB = Preconditions.checkShortRegister(registerB); this.registerB = Preconditions.checkShortRegister(registerB);
} }

View File

@ -58,7 +58,7 @@ public class ImmutableInstruction35c extends ImmutableInstruction implements Ins
int registerG, int registerG,
@Nonnull String reference) { @Nonnull String reference) {
super(opcode); super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c); Preconditions.checkFormat(opcode, FORMAT);
this.registerCount = Preconditions.check35cRegisterCount(registerCount); this.registerCount = Preconditions.check35cRegisterCount(registerCount);
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0; this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0; this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;