mirror of
https://github.com/revanced/smali.git
synced 2025-05-21 16:37:04 +02:00
Fixed logic in checking the index size of the register in various formats
git-svn-id: https://smali.googlecode.com/svn/trunk@6 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
82884f441f
commit
b759a665c8
@ -44,7 +44,7 @@ public class Format11x extends Format
|
||||
|
||||
checkOpcodeFormat(op);
|
||||
|
||||
if (regA >= 2<<8) {
|
||||
if (regA >= 1<<8) {
|
||||
throw new RuntimeException("The register number must be less than v256");
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class Format21c extends Format
|
||||
|
||||
checkOpcodeFormat(op);
|
||||
|
||||
if (regA >= 2<<8) {
|
||||
if (regA >= 1<<8) {
|
||||
throw new RuntimeException("The register number must be less than v256");
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,8 @@ public class Format22c extends Format
|
||||
|
||||
checkOpcodeFormat(op);
|
||||
|
||||
if (regA >= 16 ||
|
||||
regB >= 16) {
|
||||
if (regA >= 1<<4 ||
|
||||
regB >= 1<<4) {
|
||||
throw new RuntimeException("The register number must be less than v16");
|
||||
}
|
||||
|
||||
|
@ -50,11 +50,11 @@ public class Format35c extends Format
|
||||
if (regCount > 5) {
|
||||
throw new RuntimeException("regCount cannot be greater than 5");
|
||||
}
|
||||
if (regD >= 16 ||
|
||||
regE >= 16 ||
|
||||
regF >= 16 ||
|
||||
regG >= 16 ||
|
||||
regA >= 16) {
|
||||
if (regD >= 1<<4 ||
|
||||
regE >= 1<<4 ||
|
||||
regF >= 1<<4 ||
|
||||
regG >= 1<<4 ||
|
||||
regA >= 1<<4) {
|
||||
throw new RuntimeException("All register args must fit in 4 bits");
|
||||
}
|
||||
|
||||
|
@ -47,14 +47,14 @@ public class Format3rc extends Format
|
||||
|
||||
checkOpcodeFormat(op);
|
||||
|
||||
if (regCount >= 2<<8) {
|
||||
if (regCount >= 1<<8) {
|
||||
throw new RuntimeException("regCount must be less than 256");
|
||||
}
|
||||
if (regCount < 0) {
|
||||
throw new RuntimeException("regCount cannot be negative");
|
||||
}
|
||||
|
||||
if (startReg >= 2<<16) {
|
||||
if (startReg >= 1<<16) {
|
||||
throw new RuntimeException("The beginning register of the range must be less than 65536");
|
||||
}
|
||||
if (startReg < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user