mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 04:17:36 +02:00
Implemented verification for if-ltz/gez/gtz/lez
git-svn-id: https://smali.googlecode.com/svn/trunk@586 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -495,6 +495,11 @@ public class MethodAnalyzer {
|
||||
case IF_EQZ:
|
||||
case IF_NEZ:
|
||||
return handleIfEqzNez(analyzedInstruction);
|
||||
case IF_LTZ:
|
||||
case IF_GEZ:
|
||||
case IF_GTZ:
|
||||
case IF_LEZ:
|
||||
return handleIfz(analyzedInstruction);
|
||||
}
|
||||
assert false;
|
||||
return false;
|
||||
@ -1330,6 +1335,20 @@ public class MethodAnalyzer {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handleIfz(AnalyzedInstruction analyzedInstruction) {
|
||||
SingleRegisterInstruction instruction = (SingleRegisterInstruction)analyzedInstruction.instruction;
|
||||
|
||||
RegisterType registerType = analyzedInstruction.getPreInstructionRegisterType(instruction.getRegisterA());
|
||||
assert registerType != null;
|
||||
|
||||
if (registerType.category == RegisterType.Category.Unknown) {
|
||||
return false;
|
||||
}
|
||||
checkRegister(registerType, Primitive32BitCategories);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void checkRegister(RegisterType registerType, EnumSet validCategories) {
|
||||
if (!validCategories.contains(registerType.category)) {
|
||||
//TODO: add expected categories to error message
|
||||
|
Reference in New Issue
Block a user