mirror of
https://github.com/revanced/smali.git
synced 2025-05-22 00:37:04 +02:00
Fix a multitude of format related issues with immutable instructions
This commit is contained in:
parent
0033480503
commit
e2f2c89ddc
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user