mirror of
https://github.com/revanced/smali.git
synced 2025-05-22 19:08:52 +02:00
Propagate the narrowed type for an if-nez after an instance-of
This commit is contained in:
parent
7fd5f88caf
commit
9802cf3428
@ -1176,7 +1176,7 @@ public class MethodAnalyzer {
|
||||
AnalyzedInstruction nextAnalyzedInstruction = analyzedInstructions.valueAt(instructionIndex + 1);
|
||||
|
||||
Instruction nextInstruction = nextAnalyzedInstruction.instruction;
|
||||
if (nextInstruction.getOpcode() == Opcode.IF_EQZ) {
|
||||
if (nextInstruction.getOpcode() == Opcode.IF_EQZ || nextInstruction.getOpcode() == Opcode.IF_NEZ) {
|
||||
if (((Instruction21t)nextInstruction).getRegisterA() == analyzedInstruction.getDestinationRegister()) {
|
||||
Reference reference = ((Instruction22c)analyzedInstruction.getInstruction()).getReference();
|
||||
RegisterType registerType = RegisterType.getRegisterType(classPath, (TypeReference)reference);
|
||||
@ -1201,9 +1201,16 @@ public class MethodAnalyzer {
|
||||
}
|
||||
|
||||
if (override) {
|
||||
overridePredecessorRegisterTypeAndPropagateChanges(
|
||||
analyzedInstructions.valueAt(instructionIndex + 2), nextAnalyzedInstruction,
|
||||
objectRegister, registerType);
|
||||
AnalyzedInstruction branchStartInstruction;
|
||||
if (nextInstruction.getOpcode() == Opcode.IF_EQZ) {
|
||||
branchStartInstruction = analyzedInstructions.valueAt(instructionIndex + 2);
|
||||
} else {
|
||||
int nextAddress = getInstructionAddress(nextAnalyzedInstruction) +
|
||||
((Instruction21t)nextInstruction).getCodeOffset();
|
||||
branchStartInstruction = analyzedInstructions.get(nextAddress);
|
||||
}
|
||||
overridePredecessorRegisterTypeAndPropagateChanges(branchStartInstruction,
|
||||
nextAnalyzedInstruction, objectRegister, registerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user