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:
JesusFreke@JesusFreke.com 2009-04-17 06:04:46 +00:00
parent 82884f441f
commit b759a665c8
5 changed files with 11 additions and 11 deletions

View File

@ -44,7 +44,7 @@ public class Format11x extends Format
checkOpcodeFormat(op); checkOpcodeFormat(op);
if (regA >= 2<<8) { if (regA >= 1<<8) {
throw new RuntimeException("The register number must be less than v256"); throw new RuntimeException("The register number must be less than v256");
} }

View File

@ -49,7 +49,7 @@ public class Format21c extends Format
checkOpcodeFormat(op); checkOpcodeFormat(op);
if (regA >= 2<<8) { if (regA >= 1<<8) {
throw new RuntimeException("The register number must be less than v256"); throw new RuntimeException("The register number must be less than v256");
} }

View File

@ -47,8 +47,8 @@ public class Format22c extends Format
checkOpcodeFormat(op); checkOpcodeFormat(op);
if (regA >= 16 || if (regA >= 1<<4 ||
regB >= 16) { regB >= 1<<4) {
throw new RuntimeException("The register number must be less than v16"); throw new RuntimeException("The register number must be less than v16");
} }

View File

@ -50,11 +50,11 @@ public class Format35c extends Format
if (regCount > 5) { if (regCount > 5) {
throw new RuntimeException("regCount cannot be greater than 5"); throw new RuntimeException("regCount cannot be greater than 5");
} }
if (regD >= 16 || if (regD >= 1<<4 ||
regE >= 16 || regE >= 1<<4 ||
regF >= 16 || regF >= 1<<4 ||
regG >= 16 || regG >= 1<<4 ||
regA >= 16) { regA >= 1<<4) {
throw new RuntimeException("All register args must fit in 4 bits"); throw new RuntimeException("All register args must fit in 4 bits");
} }

View File

@ -47,14 +47,14 @@ public class Format3rc extends Format
checkOpcodeFormat(op); checkOpcodeFormat(op);
if (regCount >= 2<<8) { if (regCount >= 1<<8) {
throw new RuntimeException("regCount must be less than 256"); throw new RuntimeException("regCount must be less than 256");
} }
if (regCount < 0) { if (regCount < 0) {
throw new RuntimeException("regCount cannot be negative"); 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"); throw new RuntimeException("The beginning register of the range must be less than 65536");
} }
if (startReg < 0) { if (startReg < 0) {